// D:\tools\weixin\new\ICSharpCode.SharpZLib.Phone-cleaned.dll
// ICSharpCode.SharpZLib.Phone, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

// 架　构: AnyCPU (优先64位)
// 运行时: .NET 2.0

using ICSharpCode.SharpZipLib.Checksums;
using ICSharpCode.SharpZipLib.Encryption;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
using System;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Cryptography;
using System.Text;
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyProduct("ICSharpCode.SharpZLib.Silverlight")]
[assembly: AssemblyTitle("ICSharpCode.SharpZLib.Silverlight")]
[assembly: AssemblyTrademark("")]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: ComVisible(false)]
[assembly: Guid("e7cfa3a6-8978-413e-b754-21b37f70c584")]
[assembly: TargetFramework("Silverlight,Version=v4.0,Profile=WindowsPhone", FrameworkDisplayName = "Silverlight 4.0 Windows Phone Profile")]
namespace ICSharpCode.SharpZipLib.Checksums
{
	public sealed class Adler32 : IChecksum
	{
		private const uint uint_0 = 65521u;
		private uint uint_1;
		public long Value
		{
			get
			{
				return (long)((ulong)this.uint_1);
			}
		}
		public Adler32()
		{
			this.Reset();
		}
		public void Reset()
		{
			this.uint_1 = 1u;
		}
		public void Update(int value)
		{
			uint num = this.uint_1 & 65535u;
			uint num2 = this.uint_1 >> 16;
			num = (num + (uint)(value & 255)) % 65521u;
			num2 = (num + num2) % 65521u;
			this.uint_1 = (num2 << 16) + num;
		}
		public void Update(byte[] buffer)
		{
			if (buffer == null)
			{
				throw new ArgumentNullException("buffer");
			}
			this.Update(buffer, 0, buffer.Length);
		}
		public void Update(byte[] buffer, int offset, int count)
		{
			if (buffer == null)
			{
				throw new ArgumentNullException("buffer");
			}
			if (offset < 0)
			{
				throw new ArgumentOutOfRangeException("offset", "cannot be negative");
			}
			if (count < 0)
			{
				throw new ArgumentOutOfRangeException("count", "cannot be negative");
			}
			if (offset >= buffer.Length)
			{
				throw new ArgumentOutOfRangeException("offset", "not a valid index into buffer");
			}
			if (offset + count > buffer.Length)
			{
				throw new ArgumentOutOfRangeException("count", "exceeds buffer size");
			}
			uint num = this.uint_1 & 65535u;
			uint num2 = this.uint_1 >> 16;
			while (count > 0)
			{
				int num3 = 3800;
				if (3800 > count)
				{
					num3 = count;
				}
				count -= num3;
				while (--num3 >= 0)
				{
					num += (uint)(buffer[offset++] & 255);
					num2 += num;
				}
				num %= 65521u;
				num2 %= 65521u;
			}
			this.uint_1 = (num2 << 16 | num);
		}
	}
	public interface IChecksum
	{
		long Value
		{
			get;
		}
		void Reset();
		void Update(int value);
		void Update(byte[] buffer);
		void Update(byte[] buffer, int offset, int count);
	}
	public sealed class Crc32 : IChecksum
	{
		private const uint uint_0 = 4294967295u;
		private static readonly uint[] uint_1 = new uint[]
		{
			0u,
			1996959894u,
			3993919788u,
			2567524794u,
			124634137u,
			1886057615u,
			3915621685u,
			2657392035u,
			249268274u,
			2044508324u,
			3772115230u,
			2547177864u,
			162941995u,
			2125561021u,
			3887607047u,
			2428444049u,
			498536548u,
			1789927666u,
			4089016648u,
			2227061214u,
			450548861u,
			1843258603u,
			4107580753u,
			2211677639u,
			325883990u,
			1684777152u,
			4251122042u,
			2321926636u,
			335633487u,
			1661365465u,
			4195302755u,
			2366115317u,
			997073096u,
			1281953886u,
			3579855332u,
			2724688242u,
			1006888145u,
			1258607687u,
			3524101629u,
			2768942443u,
			901097722u,
			1119000684u,
			3686517206u,
			2898065728u,
			853044451u,
			1172266101u,
			3705015759u,
			2882616665u,
			651767980u,
			1373503546u,
			3369554304u,
			3218104598u,
			565507253u,
			1454621731u,
			3485111705u,
			3099436303u,
			671266974u,
			1594198024u,
			3322730930u,
			2970347812u,
			795835527u,
			1483230225u,
			3244367275u,
			3060149565u,
			1994146192u,
			31158534u,
			2563907772u,
			4023717930u,
			1907459465u,
			112637215u,
			2680153253u,
			3904427059u,
			2013776290u,
			251722036u,
			2517215374u,
			3775830040u,
			2137656763u,
			141376813u,
			2439277719u,
			3865271297u,
			1802195444u,
			476864866u,
			2238001368u,
			4066508878u,
			1812370925u,
			453092731u,
			2181625025u,
			4111451223u,
			1706088902u,
			314042704u,
			2344532202u,
			4240017532u,
			1658658271u,
			366619977u,
			2362670323u,
			4224994405u,
			1303535960u,
			984961486u,
			2747007092u,
			3569037538u,
			1256170817u,
			1037604311u,
			2765210733u,
			3554079995u,
			1131014506u,
			879679996u,
			2909243462u,
			3663771856u,
			1141124467u,
			855842277u,
			2852801631u,
			3708648649u,
			1342533948u,
			654459306u,
			3188396048u,
			3373015174u,
			1466479909u,
			544179635u,
			3110523913u,
			3462522015u,
			1591671054u,
			702138776u,
			2966460450u,
			3352799412u,
			1504918807u,
			783551873u,
			3082640443u,
			3233442989u,
			3988292384u,
			2596254646u,
			62317068u,
			1957810842u,
			3939845945u,
			2647816111u,
			81470997u,
			1943803523u,
			3814918930u,
			2489596804u,
			225274430u,
			2053790376u,
			3826175755u,
			2466906013u,
			167816743u,
			2097651377u,
			4027552580u,
			2265490386u,
			503444072u,
			1762050814u,
			4150417245u,
			2154129355u,
			426522225u,
			1852507879u,
			4275313526u,
			2312317920u,
			282753626u,
			1742555852u,
			4189708143u,
			2394877945u,
			397917763u,
			1622183637u,
			3604390888u,
			2714866558u,
			953729732u,
			1340076626u,
			3518719985u,
			2797360999u,
			1068828381u,
			1219638859u,
			3624741850u,
			2936675148u,
			906185462u,
			1090812512u,
			3747672003u,
			2825379669u,
			829329135u,
			1181335161u,
			3412177804u,
			3160834842u,
			628085408u,
			1382605366u,
			3423369109u,
			3138078467u,
			570562233u,
			1426400815u,
			3317316542u,
			2998733608u,
			733239954u,
			1555261956u,
			3268935591u,
			3050360625u,
			752459403u,
			1541320221u,
			2607071920u,
			3965973030u,
			1969922972u,
			40735498u,
			2617837225u,
			3943577151u,
			1913087877u,
			83908371u,
			2512341634u,
			3803740692u,
			2075208622u,
			213261112u,
			2463272603u,
			3855990285u,
			2094854071u,
			198958881u,
			2262029012u,
			4057260610u,
			1759359992u,
			534414190u,
			2176718541u,
			4139329115u,
			1873836001u,
			414664567u,
			2282248934u,
			4279200368u,
			1711684554u,
			285281116u,
			2405801727u,
			4167216745u,
			1634467795u,
			376229701u,
			2685067896u,
			3608007406u,
			1308918612u,
			956543938u,
			2808555105u,
			3495958263u,
			1231636301u,
			1047427035u,
			2932959818u,
			3654703836u,
			1088359270u,
			936918000u,
			2847714899u,
			3736837829u,
			1202900863u,
			817233897u,
			3183342108u,
			3401237130u,
			1404277552u,
			615818150u,
			3134207493u,
			3453421203u,
			1423857449u,
			601450431u,
			3009837614u,
			3294710456u,
			1567103746u,
			711928724u,
			3020668471u,
			3272380065u,
			1510334235u,
			755167117u
		};
		private uint uint_2;
		public long Value
		{
			get
			{
				return (long)((ulong)this.uint_2);
			}
			set
			{
				this.uint_2 = (uint)value;
			}
		}
		internal static uint smethod_0(uint uint_3, byte byte_0)
		{
			return Crc32.uint_1[(int)((UIntPtr)((uint_3 ^ (uint)byte_0) & 255u))] ^ uint_3 >> 8;
		}
		public void Reset()
		{
			this.uint_2 = 0u;
		}
		public void Update(int value)
		{
			this.uint_2 ^= 4294967295u;
			this.uint_2 = (Crc32.uint_1[(int)checked((IntPtr)(unchecked((ulong)this.uint_2 ^ (ulong)((long)value)) & 255uL))] ^ this.uint_2 >> 8);
			this.uint_2 ^= 4294967295u;
		}
		public void Update(byte[] buffer)
		{
			if (buffer == null)
			{
				throw new ArgumentNullException("buffer");
			}
			this.Update(buffer, 0, buffer.Length);
		}
		public void Update(byte[] buffer, int offset, int count)
		{
			if (buffer == null)
			{
				throw new ArgumentNullException("buffer");
			}
			if (count < 0)
			{
				throw new ArgumentOutOfRangeException("count", "Count cannot be less than zero");
			}
			if (offset < 0 || offset + count > buffer.Length)
			{
				throw new ArgumentOutOfRangeException("offset");
			}
			this.uint_2 ^= 4294967295u;
			while (--count >= 0)
			{
				this.uint_2 = (Crc32.uint_1[(int)((UIntPtr)((this.uint_2 ^ (uint)buffer[offset++]) & 255u))] ^ this.uint_2 >> 8);
			}
			this.uint_2 ^= 4294967295u;
		}
	}
	public class StrangeCRC : IChecksum
	{
		private static readonly uint[] uint_0 = new uint[]
		{
			0u,
			79764919u,
			159529838u,
			222504665u,
			319059676u,
			398814059u,
			445009330u,
			507990021u,
			638119352u,
			583659535u,
			797628118u,
			726387553u,
			890018660u,
			835552979u,
			1015980042u,
			944750013u,
			1276238704u,
			1221641927u,
			1167319070u,
			1095957929u,
			1595256236u,
			1540665371u,
			1452775106u,
			1381403509u,
			1780037320u,
			1859660671u,
			1671105958u,
			1733955601u,
			2031960084u,
			2111593891u,
			1889500026u,
			1952343757u,
			2552477408u,
			2632100695u,
			2443283854u,
			2506133561u,
			2334638140u,
			2414271883u,
			2191915858u,
			2254759653u,
			3190512472u,
			3135915759u,
			3081330742u,
			3009969537u,
			2905550212u,
			2850959411u,
			2762807018u,
			2691435357u,
			3560074640u,
			3505614887u,
			3719321342u,
			3648080713u,
			3342211916u,
			3287746299u,
			3467911202u,
			3396681109u,
			4063920168u,
			4143685023u,
			4223187782u,
			4286162673u,
			3779000052u,
			3858754371u,
			3904687514u,
			3967668269u,
			881225847u,
			809987520u,
			1023691545u,
			969234094u,
			662832811u,
			591600412u,
			771767749u,
			717299826u,
			311336399u,
			374308984u,
			453813921u,
			533576470u,
			25881363u,
			88864420u,
			134795389u,
			214552010u,
			2023205639u,
			2086057648u,
			1897238633u,
			1976864222u,
			1804852699u,
			1867694188u,
			1645340341u,
			1724971778u,
			1587496639u,
			1516133128u,
			1461550545u,
			1406951526u,
			1302016099u,
			1230646740u,
			1142491917u,
			1087903418u,
			2896545431u,
			2825181984u,
			2770861561u,
			2716262478u,
			3215044683u,
			3143675388u,
			3055782693u,
			3001194130u,
			2326604591u,
			2389456536u,
			2200899649u,
			2280525302u,
			2578013683u,
			2640855108u,
			2418763421u,
			2498394922u,
			3769900519u,
			3832873040u,
			3912640137u,
			3992402750u,
			4088425275u,
			4151408268u,
			4197601365u,
			4277358050u,
			3334271071u,
			3263032808u,
			3476998961u,
			3422541446u,
			3585640067u,
			3514407732u,
			3694837229u,
			3640369242u,
			1762451694u,
			1842216281u,
			1619975040u,
			1682949687u,
			2047383090u,
			2127137669u,
			1938468188u,
			2001449195u,
			1325665622u,
			1271206113u,
			1183200824u,
			1111960463u,
			1543535498u,
			1489069629u,
			1434599652u,
			1363369299u,
			622672798u,
			568075817u,
			748617968u,
			677256519u,
			907627842u,
			853037301u,
			1067152940u,
			995781531u,
			51762726u,
			131386257u,
			177728840u,
			240578815u,
			269590778u,
			349224269u,
			429104020u,
			491947555u,
			4046411278u,
			4126034873u,
			4172115296u,
			4234965207u,
			3794477266u,
			3874110821u,
			3953728444u,
			4016571915u,
			3609705398u,
			3555108353u,
			3735388376u,
			3664026991u,
			3290680682u,
			3236090077u,
			3449943556u,
			3378572211u,
			3174993278u,
			3120533705u,
			3032266256u,
			2961025959u,
			2923101090u,
			2868635157u,
			2813903052u,
			2742672763u,
			2604032198u,
			2683796849u,
			2461293480u,
			2524268063u,
			2284983834u,
			2364738477u,
			2175806836u,
			2238787779u,
			1569362073u,
			1498123566u,
			1409854455u,
			1355396672u,
			1317987909u,
			1246755826u,
			1192025387u,
			1137557660u,
			2072149281u,
			2135122070u,
			1912620623u,
			1992383480u,
			1753615357u,
			1816598090u,
			1627664531u,
			1707420964u,
			295390185u,
			358241886u,
			404320391u,
			483945776u,
			43990325u,
			106832002u,
			186451547u,
			266083308u,
			932423249u,
			861060070u,
			1041341759u,
			986742920u,
			613929101u,
			542559546u,
			756411363u,
			701822548u,
			3316196985u,
			3244833742u,
			3425377559u,
			3370778784u,
			3601682597u,
			3530312978u,
			3744426955u,
			3689838204u,
			3819031489u,
			3881883254u,
			3928223919u,
			4007849240u,
			4037393693u,
			4100235434u,
			4180117107u,
			4259748804u,
			2310601993u,
			2373574846u,
			2151335527u,
			2231098320u,
			2596047829u,
			2659030626u,
			2470359227u,
			2550115596u,
			2947551409u,
			2876312838u,
			2788305887u,
			2733848168u,
			3165939309u,
			3094707162u,
			3040238851u,
			2985771188u
		};
		private int int_0;
		public long Value
		{
			get
			{
				return (long)(~(long)this.int_0);
			}
		}
		public StrangeCRC()
		{
			this.Reset();
		}
		public void Reset()
		{
			this.int_0 = -1;
		}
		public void Update(int value)
		{
			int num = this.int_0 >> 24 ^ value;
			if (num < 0)
			{
				num = 256 + num;
			}
			this.int_0 = (int)((long)((long)this.int_0 << 8) ^ (long)((ulong)StrangeCRC.uint_0[num]));
		}
		public void Update(byte[] buffer)
		{
			if (buffer == null)
			{
				throw new ArgumentNullException("buffer");
			}
			this.Update(buffer, 0, buffer.Length);
		}
		public void Update(byte[] buffer, int offset, int count)
		{
			if (buffer == null)
			{
				throw new ArgumentNullException("buffer");
			}
			if (offset < 0)
			{
				throw new ArgumentOutOfRangeException("offset", "cannot be less than zero");
			}
			if (count < 0)
			{
				throw new ArgumentOutOfRangeException("count", "cannot be less than zero");
			}
			if (offset + count > buffer.Length)
			{
				throw new ArgumentOutOfRangeException("count");
			}
			for (int i = 0; i < count; i++)
			{
				this.Update((int)buffer[offset++]);
			}
		}
	}
}
namespace ICSharpCode.SharpZipLib.Encryption
{
	public abstract class PkzipClassic : SymmetricAlgorithm
	{
		public static byte[] GenerateKeys(byte[] seed)
		{
			if (seed == null)
			{
				throw new ArgumentNullException("seed");
			}
			if (seed.Length == 0)
			{
				throw new ArgumentException("Length is zero", "seed");
			}
			uint[] array = new uint[]
			{
				305419896u,
				591751049u,
				878082192u
			};
			for (int i = 0; i < seed.Length; i++)
			{
				array[0] = Crc32.smethod_0(array[0], seed[i]);
				array[1] = array[1] + (uint)((byte)array[0]);
				array[1] = array[1] * 134775813u + 1u;
				array[2] = Crc32.smethod_0(array[2], (byte)(array[1] >> 24));
			}
			return new byte[]
			{
				(byte)(array[0] & 255u),
				(byte)(array[0] >> 8 & 255u),
				(byte)(array[0] >> 16 & 255u),
				(byte)(array[0] >> 24 & 255u),
				(byte)(array[1] & 255u),
				(byte)(array[1] >> 8 & 255u),
				(byte)(array[1] >> 16 & 255u),
				(byte)(array[1] >> 24 & 255u),
				(byte)(array[2] & 255u),
				(byte)(array[2] >> 8 & 255u),
				(byte)(array[2] >> 16 & 255u),
				(byte)(array[2] >> 24 & 255u)
			};
		}
	}
	internal class Class38
	{
		private uint[] uint_0;
		protected byte method_0()
		{
			uint num = (this.uint_0[2] & 65535u) | 2u;
			return (byte)(num * (num ^ 1u) >> 8);
		}
		protected void method_1(byte[] byte_0)
		{
			if (byte_0 == null)
			{
				throw new ArgumentNullException("keyData");
			}
			if (byte_0.Length != 12)
			{
				throw new InvalidOperationException("Key length is not valid");
			}
			this.uint_0 = new uint[3];
			this.uint_0[0] = (uint)((int)byte_0[3] << 24 | (int)byte_0[2] << 16 | (int)byte_0[1] << 8 | (int)byte_0[0]);
			this.uint_0[1] = (uint)((int)byte_0[7] << 24 | (int)byte_0[6] << 16 | (int)byte_0[5] << 8 | (int)byte_0[4]);
			this.uint_0[2] = (uint)((int)byte_0[11] << 24 | (int)byte_0[10] << 16 | (int)byte_0[9] << 8 | (int)byte_0[8]);
		}
		protected void method_2(byte byte_0)
		{
			this.uint_0[0] = Crc32.smethod_0(this.uint_0[0], byte_0);
			this.uint_0[1] = this.uint_0[1] + (uint)((byte)this.uint_0[0]);
			this.uint_0[1] = this.uint_0[1] * 134775813u + 1u;
			this.uint_0[2] = Crc32.smethod_0(this.uint_0[2], (byte)(this.uint_0[1] >> 24));
		}
		protected void method_3()
		{
			this.uint_0[0] = 0u;
			this.uint_0[1] = 0u;
			this.uint_0[2] = 0u;
		}
	}
	internal class Class39 : Class38, ICryptoTransform, IDisposable
	{
		public bool CanReuseTransform
		{
			get
			{
				return true;
			}
		}
		public int InputBlockSize
		{
			get
			{
				return 1;
			}
		}
		public int OutputBlockSize
		{
			get
			{
				return 1;
			}
		}
		public bool CanTransformMultipleBlocks
		{
			get
			{
				return true;
			}
		}
		internal Class39(byte[] byte_0)
		{
			base.method_1(byte_0);
		}
		public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
		{
			byte[] array = new byte[inputCount];
			this.TransformBlock(inputBuffer, inputOffset, inputCount, array, 0);
			return array;
		}
		public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
		{
			for (int i = inputOffset; i < inputOffset + inputCount; i++)
			{
				byte byte_ = inputBuffer[i];
				outputBuffer[outputOffset++] = (inputBuffer[i] ^ base.method_0());
				base.method_2(byte_);
			}
			return inputCount;
		}
		public void Dispose()
		{
			base.method_3();
		}
	}
	internal class Class40 : Class38, ICryptoTransform, IDisposable
	{
		public bool CanReuseTransform
		{
			get
			{
				return true;
			}
		}
		public int InputBlockSize
		{
			get
			{
				return 1;
			}
		}
		public int OutputBlockSize
		{
			get
			{
				return 1;
			}
		}
		public bool CanTransformMultipleBlocks
		{
			get
			{
				return true;
			}
		}
		internal Class40(byte[] byte_0)
		{
			base.method_1(byte_0);
		}
		public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
		{
			byte[] array = new byte[inputCount];
			this.TransformBlock(inputBuffer, inputOffset, inputCount, array, 0);
			return array;
		}
		public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
		{
			for (int i = inputOffset; i < inputOffset + inputCount; i++)
			{
				byte b = inputBuffer[i] ^ base.method_0();
				outputBuffer[outputOffset++] = b;
				base.method_2(b);
			}
			return inputCount;
		}
		public void Dispose()
		{
			base.method_3();
		}
	}
	public sealed class PkzipClassicManaged : PkzipClassic
	{
		private byte[] byte_0;
		public override int BlockSize
		{
			get
			{
				return 8;
			}
			set
			{
				if (value != 8)
				{
					throw new CryptographicException("Block size is invalid");
				}
			}
		}
		public override KeySizes[] LegalKeySizes
		{
			get
			{
				return new KeySizes[]
				{
					new KeySizes(96, 96, 0)
				};
			}
		}
		public override KeySizes[] LegalBlockSizes
		{
			get
			{
				return new KeySizes[]
				{
					new KeySizes(8, 8, 0)
				};
			}
		}
		public override byte[] Key
		{
			get
			{
				if (this.byte_0 == null)
				{
					this.GenerateKey();
				}
				return (byte[])this.byte_0.Clone();
			}
			set
			{
				if (value == null)
				{
					throw new ArgumentNullException("value");
				}
				if (value.Length != 12)
				{
					throw new CryptographicException("Key size is illegal");
				}
				this.byte_0 = (byte[])value.Clone();
			}
		}
		public override void GenerateIV()
		{
		}
		public override void GenerateKey()
		{
			this.byte_0 = new byte[12];
			Random random = new Random();
			random.NextBytes(this.byte_0);
		}
		public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV)
		{
			this.byte_0 = rgbKey;
			return new Class39(this.get_Key());
		}
		public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV)
		{
			this.byte_0 = rgbKey;
			return new Class40(this.get_Key());
		}
	}
}
namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams
{
	public class DeflaterOutputStream : Stream
	{
		private string string_0;
		private ICryptoTransform icryptoTransform_0;
		protected byte[] AESAuthCode;
		private byte[] byte_0;
		protected Deflater deflater_;
		protected Stream baseOutputStream_;
		private bool bool_0;
		private bool bool_1 = true;
		public bool IsStreamOwner
		{
			get
			{
				return this.bool_1;
			}
			set
			{
				this.bool_1 = value;
			}
		}
		public bool CanPatchEntries
		{
			get
			{
				return this.baseOutputStream_.get_CanSeek();
			}
		}
		public string Password
		{
			get
			{
				return this.string_0;
			}
			set
			{
				if (value != null && value.get_Length() == 0)
				{
					this.string_0 = null;
				}
				else
				{
					this.string_0 = value;
				}
			}
		}
		public override bool CanRead
		{
			get
			{
				return false;
			}
		}
		public override bool CanSeek
		{
			get
			{
				return false;
			}
		}
		public override bool CanWrite
		{
			get
			{
				return this.baseOutputStream_.get_CanWrite();
			}
		}
		public override long Length
		{
			get
			{
				return this.baseOutputStream_.get_Length();
			}
		}
		public override long Position
		{
			get
			{
				return this.baseOutputStream_.get_Position();
			}
			set
			{
				throw new NotSupportedException("Position property not supported");
			}
		}
		public DeflaterOutputStream(Stream baseOutputStream) : this(baseOutputStream, new Deflater(), 512)
		{
		}
		public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater) : this(baseOutputStream, deflater, 512)
		{
		}
		public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater, int bufferSize)
		{
			if (baseOutputStream == null)
			{
				throw new ArgumentNullException("baseOutputStream");
			}
			if (!baseOutputStream.get_CanWrite())
			{
				throw new ArgumentException("Must support writing", "baseOutputStream");
			}
			if (deflater == null)
			{
				throw new ArgumentNullException("deflater");
			}
			if (bufferSize < 512)
			{
				throw new ArgumentOutOfRangeException("bufferSize");
			}
			this.baseOutputStream_ = baseOutputStream;
			this.byte_0 = new byte[bufferSize];
			this.deflater_ = deflater;
		}
		public virtual void Finish()
		{
			this.deflater_.Finish();
			while (!this.deflater_.IsFinished)
			{
				int num = this.deflater_.Deflate(this.byte_0, 0, this.byte_0.Length);
				if (num <= 0)
				{
					break;
				}
				if (this.icryptoTransform_0 != null)
				{
					this.EncryptBlock(this.byte_0, 0, num);
				}
				this.baseOutputStream_.Write(this.byte_0, 0, num);
			}
			if (!this.deflater_.IsFinished)
			{
				throw new SharpZipBaseException("Can't deflate all input?");
			}
			this.baseOutputStream_.Flush();
			if (this.icryptoTransform_0 != null)
			{
				this.icryptoTransform_0.Dispose();
				this.icryptoTransform_0 = null;
			}
		}
		protected void EncryptBlock(byte[] buffer, int offset, int length)
		{
			this.icryptoTransform_0.TransformBlock(buffer, 0, length, buffer, 0);
		}
		protected void InitializePassword(string password)
		{
			PkzipClassicManaged pkzipClassicManaged = new PkzipClassicManaged();
			byte[] array = PkzipClassic.GenerateKeys(ZipConstants.ConvertToArray(password));
			this.icryptoTransform_0 = pkzipClassicManaged.CreateEncryptor(array, null);
		}
		protected void Deflate()
		{
			while (!this.deflater_.IsNeedingInput)
			{
				int num = this.deflater_.Deflate(this.byte_0, 0, this.byte_0.Length);
				if (num <= 0)
				{
					break;
				}
				if (this.icryptoTransform_0 != null)
				{
					this.EncryptBlock(this.byte_0, 0, num);
				}
				this.baseOutputStream_.Write(this.byte_0, 0, num);
			}
			if (!this.deflater_.IsNeedingInput)
			{
				throw new SharpZipBaseException("DeflaterOutputStream can't deflate all input?");
			}
		}
		public override long Seek(long offset, SeekOrigin origin)
		{
			throw new NotSupportedException("DeflaterOutputStream Seek not supported");
		}
		public override void SetLength(long value)
		{
			throw new NotSupportedException("DeflaterOutputStream SetLength not supported");
		}
		public override int ReadByte()
		{
			throw new NotSupportedException("DeflaterOutputStream ReadByte not supported");
		}
		public override int Read(byte[] buffer, int offset, int count)
		{
			throw new NotSupportedException("DeflaterOutputStream Read not supported");
		}
		public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
		{
			throw new NotSupportedException("DeflaterOutputStream BeginRead not currently supported");
		}
		public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
		{
			throw new NotSupportedException("BeginWrite is not supported");
		}
		public override void Flush()
		{
			this.deflater_.Flush();
			this.Deflate();
			this.baseOutputStream_.Flush();
		}
		public override void Close()
		{
			if (!this.bool_0)
			{
				this.bool_0 = true;
				try
				{
					this.Finish();
					if (this.icryptoTransform_0 != null)
					{
						this.method_0();
						this.icryptoTransform_0.Dispose();
						this.icryptoTransform_0 = null;
					}
				}
				finally
				{
					if (this.bool_1)
					{
						this.baseOutputStream_.Close();
					}
				}
			}
		}
		private void method_0()
		{
		}
		public override void WriteByte(byte value)
		{
			this.Write(new byte[]
			{
				value
			}, 0, 1);
		}
		public override void Write(byte[] buffer, int offset, int count)
		{
			this.deflater_.SetInput(buffer, offset, count);
			this.Deflate();
		}
	}
	public class InflaterInputBuffer
	{
		private int int_0;
		private byte[] byte_0;
		private int int_1;
		private byte[] byte_1;
		private byte[] byte_2;
		private int int_2;
		private ICryptoTransform icryptoTransform_0;
		private Stream stream_0;
		public int RawLength
		{
			get
			{
				return this.int_0;
			}
		}
		public byte[] RawData
		{
			get
			{
				return this.byte_0;
			}
		}
		public int ClearTextLength
		{
			get
			{
				return this.int_1;
			}
		}
		public byte[] ClearText
		{
			get
			{
				return this.byte_1;
			}
		}
		public int Available
		{
			get
			{
				return this.int_2;
			}
			set
			{
				this.int_2 = value;
			}
		}
		public ICryptoTransform CryptoTransform
		{
			set
			{
				this.icryptoTransform_0 = value;
				if (this.icryptoTransform_0 != null)
				{
					if (this.byte_0 == this.byte_1)
					{
						if (this.byte_2 == null)
						{
							this.byte_2 = new byte[this.byte_0.Length];
						}
						this.byte_1 = this.byte_2;
					}
					this.int_1 = this.int_0;
					if (this.int_2 > 0)
					{
						this.icryptoTransform_0.TransformBlock(this.byte_0, this.int_0 - this.int_2, this.int_2, this.byte_1, this.int_0 - this.int_2);
					}
				}
				else
				{
					this.byte_1 = this.byte_0;
					this.int_1 = this.int_0;
				}
			}
		}
		public InflaterInputBuffer(Stream stream) : this(stream, 4096)
		{
		}
		public InflaterInputBuffer(Stream stream, int bufferSize)
		{
			this.stream_0 = stream;
			if (bufferSize < 1024)
			{
				bufferSize = 1024;
			}
			this.byte_0 = new byte[bufferSize];
			this.byte_1 = this.byte_0;
		}
		public void SetInflaterInput(Inflater inflater)
		{
			if (this.int_2 > 0)
			{
				inflater.SetInput(this.byte_1, this.int_1 - this.int_2, this.int_2);
				this.int_2 = 0;
			}
		}
		public void Fill()
		{
			this.int_0 = 0;
			int num;
			for (int i = this.byte_0.Length; i > 0; i -= num)
			{
				num = this.stream_0.Read(this.byte_0, this.int_0, i);
				if (num <= 0)
				{
					break;
				}
				this.int_0 += num;
			}
			if (this.icryptoTransform_0 != null)
			{
				this.int_1 = this.icryptoTransform_0.TransformBlock(this.byte_0, 0, this.int_0, this.byte_1, 0);
			}
			else
			{
				this.int_1 = this.int_0;
			}
			this.int_2 = this.int_1;
		}
		public int ReadRawBuffer(byte[] buffer)
		{
			return this.ReadRawBuffer(buffer, 0, buffer.Length);
		}
		public int ReadRawBuffer(byte[] outBuffer, int offset, int length)
		{
			if (length < 0)
			{
				throw new ArgumentOutOfRangeException("length");
			}
			int num = offset;
			int i = length;
			int result;
			while (i > 0)
			{
				if (this.int_2 <= 0)
				{
					this.Fill();
					if (this.int_2 <= 0)
					{
						result = 0;
						return result;
					}
				}
				int num2 = Math.Min(i, this.int_2);
				Array.Copy(this.byte_0, this.int_0 - this.int_2, outBuffer, num, num2);
				num += num2;
				i -= num2;
				this.int_2 -= num2;
			}
			result = length;
			return result;
		}
		public int ReadClearTextBuffer(byte[] outBuffer, int offset, int length)
		{
			if (length < 0)
			{
				throw new ArgumentOutOfRangeException("length");
			}
			int num = offset;
			int i = length;
			int result;
			while (i > 0)
			{
				if (this.int_2 <= 0)
				{
					this.Fill();
					if (this.int_2 <= 0)
					{
						result = 0;
						return result;
					}
				}
				int num2 = Math.Min(i, this.int_2);
				Array.Copy(this.byte_1, this.int_1 - this.int_2, outBuffer, num, num2);
				num += num2;
				i -= num2;
				this.int_2 -= num2;
			}
			result = length;
			return result;
		}
		public int ReadLeByte()
		{
			if (this.int_2 <= 0)
			{
				this.Fill();
				if (this.int_2 <= 0)
				{
					throw new ZipException("EOF in header");
				}
			}
			byte result = this.byte_0[this.int_0 - this.int_2];
			this.int_2--;
			return (int)result;
		}
		public int ReadLeShort()
		{
			return this.ReadLeByte() | this.ReadLeByte() << 8;
		}
		public int ReadLeInt()
		{
			return this.ReadLeShort() | this.ReadLeShort() << 16;
		}
		public long ReadLeLong()
		{
			return (long)((ulong)this.ReadLeInt() | (ulong)((ulong)((long)this.ReadLeInt()) << 32));
		}
	}
	public class InflaterInputStream : Stream
	{
		protected Inflater inflater_0;
		protected InflaterInputBuffer inputBuffer;
		private Stream stream_0;
		protected long csize;
		private bool bool_0;
		private bool bool_1 = true;
		public bool IsStreamOwner
		{
			get
			{
				return this.bool_1;
			}
			set
			{
				this.bool_1 = value;
			}
		}
		public virtual int Available
		{
			get
			{
				return this.inflater_0.IsFinished ? 0 : 1;
			}
		}
		public override bool CanRead
		{
			get
			{
				return this.stream_0.get_CanRead();
			}
		}
		public override bool CanSeek
		{
			get
			{
				return false;
			}
		}
		public override bool CanWrite
		{
			get
			{
				return false;
			}
		}
		public override long Length
		{
			get
			{
				return (long)this.inputBuffer.RawLength;
			}
		}
		public override long Position
		{
			get
			{
				return this.stream_0.get_Position();
			}
			set
			{
				throw new NotSupportedException("InflaterInputStream Position not supported");
			}
		}
		public InflaterInputStream(Stream baseInputStream) : this(baseInputStream, new Inflater(), 4096)
		{
		}
		public InflaterInputStream(Stream baseInputStream, Inflater inflater_1) : this(baseInputStream, inflater_1, 4096)
		{
		}
		public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize)
		{
			if (baseInputStream == null)
			{
				throw new ArgumentNullException("baseInputStream");
			}
			if (inflater == null)
			{
				throw new ArgumentNullException("inflater");
			}
			if (bufferSize <= 0)
			{
				throw new ArgumentOutOfRangeException("bufferSize");
			}
			this.stream_0 = baseInputStream;
			this.inflater_0 = inflater;
			this.inputBuffer = new InflaterInputBuffer(baseInputStream, bufferSize);
		}
		public long Skip(long count)
		{
			if (count <= 0L)
			{
				throw new ArgumentOutOfRangeException("count");
			}
			long result;
			if (this.stream_0.get_CanSeek())
			{
				this.stream_0.Seek(count, 1);
				result = count;
			}
			else
			{
				int num = 2048;
				if (count < 2048L)
				{
					num = (int)count;
				}
				byte[] array = new byte[num];
				int num2 = 1;
				long num3 = count;
				while (num3 > 0L && num2 > 0)
				{
					if (num3 < (long)num)
					{
						num = (int)num3;
					}
					num2 = this.stream_0.Read(array, 0, num);
					num3 -= (long)num2;
				}
				result = count - num3;
			}
			return result;
		}
		protected void StopDecrypting()
		{
			this.inputBuffer.CryptoTransform = null;
		}
		protected void Fill()
		{
			if (this.inputBuffer.Available <= 0)
			{
				this.inputBuffer.Fill();
				if (this.inputBuffer.Available <= 0)
				{
					throw new SharpZipBaseException("Unexpected EOF");
				}
			}
			this.inputBuffer.SetInflaterInput(this.inflater_0);
		}
		public override void Flush()
		{
			this.stream_0.Flush();
		}
		public override long Seek(long offset, SeekOrigin origin)
		{
			throw new NotSupportedException("Seek not supported");
		}
		public override void SetLength(long value)
		{
			throw new NotSupportedException("InflaterInputStream SetLength not supported");
		}
		public override void Write(byte[] buffer, int offset, int count)
		{
			throw new NotSupportedException("InflaterInputStream Write not supported");
		}
		public override void WriteByte(byte value)
		{
			throw new NotSupportedException("InflaterInputStream WriteByte not supported");
		}
		public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
		{
			throw new NotSupportedException("InflaterInputStream BeginWrite not supported");
		}
		public override void Close()
		{
			if (!this.bool_0)
			{
				this.bool_0 = true;
				if (this.bool_1)
				{
					this.stream_0.Close();
				}
			}
		}
		public override int Read(byte[] buffer, int offset, int count)
		{
			if (this.inflater_0.IsNeedingDictionary)
			{
				throw new SharpZipBaseException("Need a dictionary");
			}
			int num = count;
			while (true)
			{
				int num2 = this.inflater_0.Inflate(buffer, offset, num);
				offset += num2;
				num -= num2;
				if (num == 0 || this.inflater_0.IsFinished)
				{
					goto IL_83;
				}
				if (this.inflater_0.IsNeedingInput)
				{
					this.Fill();
				}
				else
				{
					if (num2 == 0)
					{
						break;
					}
				}
			}
			throw new ZipException("Dont know what to do");
			IL_83:
			return count - num;
		}
	}
	public class OutputWindow
	{
		private const int int_0 = 32768;
		private const int int_1 = 32767;
		private byte[] byte_0 = new byte[32768];
		private int int_2;
		private int int_3;
		public void Write(int value)
		{
			if (this.int_3++ == 32768)
			{
				throw new InvalidOperationException("Window full");
			}
			this.byte_0[this.int_2++] = (byte)value;
			this.int_2 &= 32767;
		}
		private void method_0(int int_4, int int_5, int int_6)
		{
			while (int_5-- > 0)
			{
				this.byte_0[this.int_2++] = this.byte_0[int_4++];
				this.int_2 &= 32767;
				int_4 &= 32767;
			}
		}
		public void Repeat(int length, int distance)
		{
			if ((this.int_3 += length) > 32768)
			{
				throw new InvalidOperationException("Window full");
			}
			int num = this.int_2 - distance & 32767;
			int num2 = 32768 - length;
			if (num <= num2 && this.int_2 < num2)
			{
				if (length <= distance)
				{
					Array.Copy(this.byte_0, num, this.byte_0, this.int_2, length);
					this.int_2 += length;
				}
				else
				{
					while (length-- > 0)
					{
						this.byte_0[this.int_2++] = this.byte_0[num++];
					}
				}
			}
			else
			{
				this.method_0(num, length, distance);
			}
		}
		public int CopyStored(StreamManipulator input, int length)
		{
			length = Math.Min(Math.Min(length, 32768 - this.int_3), input.AvailableBytes);
			int num = 32768 - this.int_2;
			int num2;
			if (length > num)
			{
				num2 = input.CopyBytes(this.byte_0, this.int_2, num);
				if (num2 == num)
				{
					num2 += input.CopyBytes(this.byte_0, 0, length - num);
				}
			}
			else
			{
				num2 = input.CopyBytes(this.byte_0, this.int_2, length);
			}
			this.int_2 = (this.int_2 + num2 & 32767);
			this.int_3 += num2;
			return num2;
		}
		public void CopyDict(byte[] dictionary, int offset, int length)
		{
			if (dictionary == null)
			{
				throw new ArgumentNullException("dictionary");
			}
			if (this.int_3 > 0)
			{
				throw new InvalidOperationException();
			}
			if (length > 32768)
			{
				offset += length - 32768;
				length = 32768;
			}
			Array.Copy(dictionary, offset, this.byte_0, 0, length);
			this.int_2 = (length & 32767);
		}
		public int GetFreeSpace()
		{
			return 32768 - this.int_3;
		}
		public int GetAvailable()
		{
			return this.int_3;
		}
		public int CopyOutput(byte[] output, int offset, int int_4)
		{
			int num = this.int_2;
			if (int_4 > this.int_3)
			{
				int_4 = this.int_3;
			}
			else
			{
				num = (this.int_2 - this.int_3 + int_4 & 32767);
			}
			int num2 = int_4;
			int num3 = int_4 - num;
			if (num3 > 0)
			{
				Array.Copy(this.byte_0, 32768 - num3, output, offset, num3);
				offset += num3;
				int_4 = num;
			}
			Array.Copy(this.byte_0, num - int_4, output, offset, int_4);
			this.int_3 -= num2;
			if (this.int_3 < 0)
			{
				throw new InvalidOperationException();
			}
			return num2;
		}
		public void Reset()
		{
			this.int_2 = 0;
			this.int_3 = 0;
		}
	}
	public class StreamManipulator
	{
		private byte[] byte_0;
		private int int_0;
		private int int_1;
		private uint uint_0;
		private int int_2;
		public int AvailableBits
		{
			get
			{
				return this.int_2;
			}
		}
		public int AvailableBytes
		{
			get
			{
				return this.int_1 - this.int_0 + (this.int_2 >> 3);
			}
		}
		public bool IsNeedingInput
		{
			get
			{
				return this.int_0 == this.int_1;
			}
		}
		public int PeekBits(int bitCount)
		{
			int result;
			if (this.int_2 < bitCount)
			{
				if (this.int_0 == this.int_1)
				{
					result = -1;
					return result;
				}
				this.uint_0 |= (uint)((uint)((int)(this.byte_0[this.int_0++] & 255) | (int)(this.byte_0[this.int_0++] & 255) << 8) << this.int_2);
				this.int_2 += 16;
			}
			result = (int)((ulong)this.uint_0 & (ulong)((long)((1 << bitCount) - 1)));
			return result;
		}
		public void DropBits(int bitCount)
		{
			this.uint_0 >>= bitCount;
			this.int_2 -= bitCount;
		}
		public int GetBits(int bitCount)
		{
			int num = this.PeekBits(bitCount);
			if (num >= 0)
			{
				this.DropBits(bitCount);
			}
			return num;
		}
		public void SkipToByteBoundary()
		{
			this.uint_0 >>= (this.int_2 & 7);
			this.int_2 &= -8;
		}
		public int CopyBytes(byte[] output, int offset, int length)
		{
			if (length < 0)
			{
				throw new ArgumentOutOfRangeException("length");
			}
			if ((this.int_2 & 7) != 0)
			{
				throw new InvalidOperationException("Bit buffer is not byte aligned!");
			}
			int num = 0;
			while (this.int_2 > 0 && length > 0)
			{
				output[offset++] = (byte)this.uint_0;
				this.uint_0 >>= 8;
				this.int_2 -= 8;
				length--;
				num++;
			}
			int result;
			if (length == 0)
			{
				result = num;
			}
			else
			{
				int num2 = this.int_1 - this.int_0;
				if (length > num2)
				{
					length = num2;
				}
				Array.Copy(this.byte_0, this.int_0, output, offset, length);
				this.int_0 += length;
				if ((this.int_0 - this.int_1 & 1) != 0)
				{
					this.uint_0 = (uint)(this.byte_0[this.int_0++] & 255);
					this.int_2 = 8;
				}
				result = num + length;
			}
			return result;
		}
		public void Reset()
		{
			this.uint_0 = 0u;
			this.int_2 = 0;
			this.int_1 = 0;
			this.int_0 = 0;
		}
		public void SetInput(byte[] buffer, int offset, int count)
		{
			if (buffer == null)
			{
				throw new ArgumentNullException("buffer");
			}
			if (offset < 0)
			{
				throw new ArgumentOutOfRangeException("offset", "Cannot be negative");
			}
			if (count < 0)
			{
				throw new ArgumentOutOfRangeException("count", "Cannot be negative");
			}
			if (this.int_0 < this.int_1)
			{
				throw new InvalidOperationException("Old input was not completely processed");
			}
			int num = offset + count;
			if (offset > num || num > buffer.Length)
			{
				throw new ArgumentOutOfRangeException("count");
			}
			if ((count & 1) != 0)
			{
				this.uint_0 |= (uint)((uint)(buffer[offset++] & 255) << this.int_2);
				this.int_2 += 8;
			}
			this.byte_0 = buffer;
			this.int_0 = offset;
			this.int_1 = num;
		}
	}
}
[CompilerGenerated]
internal class Class41
{
	[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 1024)]
	private struct Struct48
	{
	}
	[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 12)]
	private struct Struct49
	{
	}
	[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 40)]
	private struct Struct50
	{
	}
	[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 76)]
	private struct Struct51
	{
	}
	[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 16)]
	private struct Struct52
	{
	}
	[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 116)]
	private struct Struct53
	{
	}
	[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 120)]
	private struct Struct54
	{
	}
	internal static Class41.Struct48 struct48_0;
	internal static Class41.Struct48 struct48_1;
	internal static Class41.Struct49 struct49_0;
	internal static Class41.Struct50 struct50_0;
	internal static Class41.Struct50 struct50_1;
	internal static Class41.Struct50 struct50_2;
	internal static Class41.Struct50 struct50_3;
	internal static Class41.Struct50 struct50_4;
	internal static Class41.Struct51 struct51_0;
	internal static Class41.Struct52 struct52_0;
	internal static Class41.Struct53 struct53_0;
	internal static Class41.Struct53 struct53_1;
	internal static Class41.Struct54 struct54_0;
	internal static Class41.Struct54 struct54_1;
	internal static Class41.Struct49 struct49_1;
	internal static Class41.Struct49 struct49_2;
	internal static Class41.Struct51 struct51_1;
}
namespace ICSharpCode.SharpZipLib
{
	public class SharpZipBaseException : Exception
	{
		public SharpZipBaseException()
		{
		}
		public SharpZipBaseException(string message) : base(message)
		{
		}
		public SharpZipBaseException(string message, Exception innerException) : base(message, innerException)
		{
		}
	}
}
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
	public class Deflater
	{
		public const int BEST_COMPRESSION = 9;
		public const int BEST_SPEED = 1;
		public const int DEFAULT_COMPRESSION = -1;
		public const int NO_COMPRESSION = 0;
		public const int DEFLATED = 8;
		private const int int_0 = 1;
		private const int int_1 = 4;
		private const int int_2 = 8;
		private const int int_3 = 0;
		private const int int_4 = 1;
		private const int int_5 = 16;
		private const int int_6 = 20;
		private const int int_7 = 28;
		private const int int_8 = 30;
		private const int int_9 = 127;
		private int int_10;
		private bool bool_0;
		private int int_11;
		private long long_0;
		private DeflaterPending deflaterPending_0;
		private DeflaterEngine deflaterEngine_0;
		public int Adler
		{
			get
			{
				return this.deflaterEngine_0.Adler;
			}
		}
		public long TotalIn
		{
			get
			{
				return this.deflaterEngine_0.TotalIn;
			}
		}
		public long TotalOut
		{
			get
			{
				return this.long_0;
			}
		}
		public bool IsFinished
		{
			get
			{
				return this.int_11 == 30 && this.deflaterPending_0.IsFlushed;
			}
		}
		public bool IsNeedingInput
		{
			get
			{
				return this.deflaterEngine_0.NeedsInput();
			}
		}
		public Deflater() : this(-1, false)
		{
		}
		public Deflater(int level) : this(level, false)
		{
		}
		public Deflater(int level, bool noZlibHeaderOrFooter)
		{
			if (level == -1)
			{
				level = 6;
			}
			else
			{
				if (level < 0 || level > 9)
				{
					throw new ArgumentOutOfRangeException("level");
				}
			}
			this.deflaterPending_0 = new DeflaterPending();
			this.deflaterEngine_0 = new DeflaterEngine(this.deflaterPending_0);
			this.bool_0 = noZlibHeaderOrFooter;
			this.SetStrategy(DeflateStrategy.Default);
			this.SetLevel(level);
			this.Reset();
		}
		public void Reset()
		{
			this.int_11 = (this.bool_0 ? 16 : 0);
			this.long_0 = 0L;
			this.deflaterPending_0.Reset();
			this.deflaterEngine_0.Reset();
		}
		public void Flush()
		{
			this.int_11 |= 4;
		}
		public void Finish()
		{
			this.int_11 |= 12;
		}
		public void SetInput(byte[] input)
		{
			this.SetInput(input, 0, input.Length);
		}
		public void SetInput(byte[] input, int offset, int count)
		{
			if ((this.int_11 & 8) != 0)
			{
				throw new InvalidOperationException("Finish() already called");
			}
			this.deflaterEngine_0.SetInput(input, offset, count);
		}
		public void SetLevel(int level)
		{
			if (level == -1)
			{
				level = 6;
			}
			else
			{
				if (level < 0 || level > 9)
				{
					throw new ArgumentOutOfRangeException("level");
				}
			}
			if (this.int_10 != level)
			{
				this.int_10 = level;
				this.deflaterEngine_0.SetLevel(level);
			}
		}
		public int GetLevel()
		{
			return this.int_10;
		}
		public void SetStrategy(DeflateStrategy strategy)
		{
			this.deflaterEngine_0.Strategy = strategy;
		}
		public int Deflate(byte[] output)
		{
			return this.Deflate(output, 0, output.Length);
		}
		public int Deflate(byte[] output, int offset, int length)
		{
			int num = length;
			if (this.int_11 == 127)
			{
				throw new InvalidOperationException("Deflater closed");
			}
			if (this.int_11 < 16)
			{
				int num2 = 30720;
				int num3 = this.int_10 - 1 >> 1;
				if (num3 < 0 || num3 > 3)
				{
					num3 = 3;
				}
				num2 |= num3 << 6;
				if ((this.int_11 & 1) != 0)
				{
					num2 |= 32;
				}
				num2 += 31 - num2 % 31;
				this.deflaterPending_0.WriteShortMSB(num2);
				if ((this.int_11 & 1) != 0)
				{
					int adler = this.deflaterEngine_0.Adler;
					this.deflaterEngine_0.ResetAdler();
					this.deflaterPending_0.WriteShortMSB(adler >> 16);
					this.deflaterPending_0.WriteShortMSB(adler & 65535);
				}
				this.int_11 = (16 | (this.int_11 & 12));
			}
			while (true)
			{
				int num4 = this.deflaterPending_0.Flush(output, offset, length);
				offset += num4;
				this.long_0 += (long)num4;
				length -= num4;
				if (length == 0 || this.int_11 == 30)
				{
					break;
				}
				if (!this.deflaterEngine_0.Deflate((this.int_11 & 4) != 0, (this.int_11 & 8) != 0))
				{
					if (this.int_11 == 16)
					{
						goto IL_226;
					}
					if (this.int_11 == 20)
					{
						if (this.int_10 != 0)
						{
							for (int i = 8 + (-this.deflaterPending_0.BitCount & 7); i > 0; i -= 10)
							{
								this.deflaterPending_0.WriteBits(2, 10);
							}
						}
						this.int_11 = 16;
					}
					else
					{
						if (this.int_11 == 28)
						{
							this.deflaterPending_0.AlignToByte();
							if (!this.bool_0)
							{
								int adler2 = this.deflaterEngine_0.Adler;
								this.deflaterPending_0.WriteShortMSB(adler2 >> 16);
								this.deflaterPending_0.WriteShortMSB(adler2 & 65535);
							}
							this.int_11 = 30;
						}
					}
				}
			}
			int result = num - length;
			return result;
			IL_226:
			result = num - length;
			return result;
		}
		public void SetDictionary(byte[] dictionary)
		{
			this.SetDictionary(dictionary, 0, dictionary.Length);
		}
		public void SetDictionary(byte[] dictionary, int index, int count)
		{
			if (this.int_11 != 0)
			{
				throw new InvalidOperationException();
			}
			this.int_11 = 1;
			this.deflaterEngine_0.SetDictionary(dictionary, index, count);
		}
	}
	public class DeflaterConstants
	{
		public const bool DEBUGGING = false;
		public const int STORED_BLOCK = 0;
		public const int STATIC_TREES = 1;
		public const int DYN_TREES = 2;
		public const int PRESET_DICT = 32;
		public const int DEFAULT_MEM_LEVEL = 8;
		public const int MAX_MATCH = 258;
		public const int MIN_MATCH = 3;
		public const int MAX_WBITS = 15;
		public const int WSIZE = 32768;
		public const int WMASK = 32767;
		public const int HASH_BITS = 15;
		public const int HASH_SIZE = 32768;
		public const int HASH_MASK = 32767;
		public const int HASH_SHIFT = 5;
		public const int MIN_LOOKAHEAD = 262;
		public const int MAX_DIST = 32506;
		public const int PENDING_BUF_SIZE = 65536;
		public const int DEFLATE_STORED = 0;
		public const int DEFLATE_FAST = 1;
		public const int DEFLATE_SLOW = 2;
		public static int MAX_BLOCK_SIZE = Math.Min(65535, 65531);
		public static int[] GOOD_LENGTH = new int[]
		{
			0,
			4,
			4,
			4,
			4,
			8,
			8,
			8,
			32,
			32
		};
		public static int[] MAX_LAZY = new int[]
		{
			0,
			4,
			5,
			6,
			4,
			16,
			16,
			32,
			128,
			258
		};
		public static int[] NICE_LENGTH = new int[]
		{
			0,
			8,
			16,
			32,
			16,
			32,
			128,
			128,
			258,
			258
		};
		public static int[] MAX_CHAIN = new int[]
		{
			0,
			4,
			8,
			32,
			16,
			32,
			128,
			256,
			1024,
			4096
		};
		public static int[] COMPR_FUNC = new int[]
		{
			0,
			1,
			1,
			1,
			1,
			2,
			2,
			2,
			2,
			2
		};
	}
	public enum DeflateStrategy
	{
		Default,
		Filtered,
		HuffmanOnly
	}
	public class DeflaterEngine : DeflaterConstants
	{
		private const int int_0 = 4096;
		private int int_1;
		private short[] short_0;
		private short[] short_1;
		private int int_2;
		private int int_3;
		private bool bool_0;
		private int int_4;
		private int int_5;
		private int int_6;
		private byte[] byte_0;
		private DeflateStrategy deflateStrategy_0;
		private int int_7;
		private int int_8;
		private int int_9;
		private int int_10;
		private int int_11;
		private byte[] byte_1;
		private long long_0;
		private int int_12;
		private int int_13;
		private DeflaterPending deflaterPending_0;
		private DeflaterHuffman deflaterHuffman_0;
		private Adler32 adler32_0;
		public int Adler
		{
			get
			{
				return (int)this.adler32_0.Value;
			}
		}
		public long TotalIn
		{
			get
			{
				return this.long_0;
			}
		}
		public DeflateStrategy Strategy
		{
			get
			{
				return this.deflateStrategy_0;
			}
			set
			{
				this.deflateStrategy_0 = value;
			}
		}
		public DeflaterEngine(DeflaterPending pending)
		{
			this.deflaterPending_0 = pending;
			this.deflaterHuffman_0 = new DeflaterHuffman(pending);
			this.adler32_0 = new Adler32();
			this.byte_0 = new byte[65536];
			this.short_0 = new short[32768];
			this.short_1 = new short[32768];
			this.int_5 = 1;
			this.int_4 = 1;
		}
		public bool Deflate(bool flush, bool finish)
		{
			while (true)
			{
				this.FillWindow();
				bool bool_ = flush && this.int_12 == this.int_13;
				bool flag;
				switch (this.int_11)
				{
				case 0:
					flag = this.method_4(bool_, finish);
					goto IL_44;
				case 1:
					flag = this.method_5(bool_, finish);
					goto IL_44;
				case 2:
					flag = this.method_6(bool_, finish);
					goto IL_44;
				}
				break;
				IL_44:
				if (!this.deflaterPending_0.IsFlushed || !flag)
				{
					return flag;
				}
			}
			throw new InvalidOperationException("unknown compressionFunction");
		}
		public void SetInput(byte[] buffer, int offset, int count)
		{
			if (buffer == null)
			{
				throw new ArgumentNullException("buffer");
			}
			if (offset < 0)
			{
				throw new ArgumentOutOfRangeException("offset");
			}
			if (count < 0)
			{
				throw new ArgumentOutOfRangeException("count");
			}
			if (this.int_12 < this.int_13)
			{
				throw new InvalidOperationException("Old input was not completely processed");
			}
			int num = offset + count;
			if (offset > num || num > buffer.Length)
			{
				throw new ArgumentOutOfRangeException("count");
			}
			this.byte_1 = buffer;
			this.int_12 = offset;
			this.int_13 = num;
		}
		public bool NeedsInput()
		{
			return this.int_13 == this.int_12;
		}
		public void SetDictionary(byte[] buffer, int offset, int length)
		{
			this.adler32_0.Update(buffer, offset, length);
			if (length >= 3)
			{
				if (length > 32506)
				{
					offset += length - 32506;
					length = 32506;
				}
				Array.Copy(buffer, offset, this.byte_0, this.int_5, length);
				this.method_0();
				length--;
				while (--length > 0)
				{
					this.method_1();
					this.int_5++;
				}
				this.int_5 += 2;
				this.int_4 = this.int_5;
			}
		}
		public void Reset()
		{
			this.deflaterHuffman_0.Reset();
			this.adler32_0.Reset();
			this.int_5 = 1;
			this.int_4 = 1;
			this.int_6 = 0;
			this.long_0 = 0L;
			this.bool_0 = false;
			this.int_3 = 2;
			for (int i = 0; i < 32768; i++)
			{
				this.short_0[i] = 0;
			}
			for (int i = 0; i < 32768; i++)
			{
				this.short_1[i] = 0;
			}
		}
		public void ResetAdler()
		{
			this.adler32_0.Reset();
		}
		public void SetLevel(int level)
		{
			if (level < 0 || level > 9)
			{
				throw new ArgumentOutOfRangeException("level");
			}
			this.int_10 = DeflaterConstants.GOOD_LENGTH[level];
			this.int_8 = DeflaterConstants.MAX_LAZY[level];
			this.int_9 = DeflaterConstants.NICE_LENGTH[level];
			this.int_7 = DeflaterConstants.MAX_CHAIN[level];
			if (DeflaterConstants.COMPR_FUNC[level] != this.int_11)
			{
				switch (this.int_11)
				{
				case 0:
					if (this.int_5 > this.int_4)
					{
						this.deflaterHuffman_0.FlushStoredBlock(this.byte_0, this.int_4, this.int_5 - this.int_4, false);
						this.int_4 = this.int_5;
					}
					this.method_0();
					break;
				case 1:
					if (this.int_5 > this.int_4)
					{
						this.deflaterHuffman_0.FlushBlock(this.byte_0, this.int_4, this.int_5 - this.int_4, false);
						this.int_4 = this.int_5;
					}
					break;
				case 2:
					if (this.bool_0)
					{
						this.deflaterHuffman_0.TallyLit((int)(this.byte_0[this.int_5 - 1] & 255));
					}
					if (this.int_5 > this.int_4)
					{
						this.deflaterHuffman_0.FlushBlock(this.byte_0, this.int_4, this.int_5 - this.int_4, false);
						this.int_4 = this.int_5;
					}
					this.bool_0 = false;
					this.int_3 = 2;
					break;
				}
				this.int_11 = DeflaterConstants.COMPR_FUNC[level];
			}
		}
		public void FillWindow()
		{
			if (this.int_5 >= 65274)
			{
				this.method_2();
			}
			while (this.int_6 < 262 && this.int_12 < this.int_13)
			{
				int num = 65536 - this.int_6 - this.int_5;
				if (num > this.int_13 - this.int_12)
				{
					num = this.int_13 - this.int_12;
				}
				Array.Copy(this.byte_1, this.int_12, this.byte_0, this.int_5 + this.int_6, num);
				this.adler32_0.Update(this.byte_1, this.int_12, num);
				this.int_12 += num;
				this.long_0 += (long)num;
				this.int_6 += num;
			}
			if (this.int_6 >= 3)
			{
				this.method_0();
			}
		}
		private void method_0()
		{
			this.int_1 = ((int)this.byte_0[this.int_5] << 5 ^ (int)this.byte_0[this.int_5 + 1]);
		}
		private int method_1()
		{
			int num = (this.int_1 << 5 ^ (int)this.byte_0[this.int_5 + 2]) & 32767;
			short num2 = this.short_1[this.int_5 & 32767] = this.short_0[num];
			this.short_0[num] = (short)this.int_5;
			this.int_1 = num;
			return (int)num2 & 65535;
		}
		private void method_2()
		{
			Array.Copy(this.byte_0, 32768, this.byte_0, 0, 32768);
			this.int_2 -= 32768;
			this.int_5 -= 32768;
			this.int_4 -= 32768;
			for (int i = 0; i < 32768; i++)
			{
				int num = (int)this.short_0[i] & 65535;
				this.short_0[i] = (short)((num >= 32768) ? (num - 32768) : 0);
			}
			for (int i = 0; i < 32768; i++)
			{
				int num = (int)this.short_1[i] & 65535;
				this.short_1[i] = (short)((num >= 32768) ? (num - 32768) : 0);
			}
		}
		private bool method_3(int int_14)
		{
			int num = this.int_7;
			int num2 = this.int_9;
			short[] array = this.short_1;
			int num3 = this.int_5;
			int num4 = this.int_5 + this.int_3;
			int num5 = Math.Max(this.int_3, 2);
			int num6 = Math.Max(this.int_5 - 32506, 0);
			int num7 = this.int_5 + 258 - 1;
			byte b = this.byte_0[num4 - 1];
			byte b2 = this.byte_0[num4];
			if (num5 >= this.int_10)
			{
				num >>= 2;
			}
			if (num2 > this.int_6)
			{
				num2 = this.int_6;
			}
			do
			{
				if (this.byte_0[int_14 + num5] == b2 && this.byte_0[int_14 + num5 - 1] == b && this.byte_0[int_14] == this.byte_0[num3] && this.byte_0[int_14 + 1] == this.byte_0[num3 + 1])
				{
					int num8 = int_14 + 2;
					num3 += 2;
					while (this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && num3 < num7)
					{
					}
					if (num3 > num4)
					{
						this.int_2 = int_14;
						num4 = num3;
						num5 = num3 - this.int_5;
						if (num5 >= num2)
						{
							break;
						}
						b = this.byte_0[num4 - 1];
						b2 = this.byte_0[num4];
					}
					num3 = this.int_5;
				}
			}
			while ((int_14 = ((int)array[int_14 & 32767] & 65535)) > num6 && --num != 0);
			this.int_3 = Math.Min(num5, this.int_6);
			return this.int_3 >= 3;
		}
		private bool method_4(bool bool_1, bool bool_2)
		{
			bool result;
			if (!bool_1 && this.int_6 == 0)
			{
				result = false;
			}
			else
			{
				this.int_5 += this.int_6;
				this.int_6 = 0;
				int num = this.int_5 - this.int_4;
				if (num >= DeflaterConstants.MAX_BLOCK_SIZE || (this.int_4 < 32768 && num >= 32506) || bool_1)
				{
					bool flag = bool_2;
					if (num > DeflaterConstants.MAX_BLOCK_SIZE)
					{
						num = DeflaterConstants.MAX_BLOCK_SIZE;
						flag = false;
					}
					this.deflaterHuffman_0.FlushStoredBlock(this.byte_0, this.int_4, num, flag);
					this.int_4 += num;
					result = !flag;
				}
				else
				{
					result = true;
				}
			}
			return result;
		}
		private bool method_5(bool bool_1, bool bool_2)
		{
			bool result;
			if (this.int_6 < 262 && !bool_1)
			{
				result = false;
			}
			else
			{
				while (this.int_6 >= 262 || bool_1)
				{
					if (this.int_6 == 0)
					{
						this.deflaterHuffman_0.FlushBlock(this.byte_0, this.int_4, this.int_5 - this.int_4, bool_2);
						this.int_4 = this.int_5;
						result = false;
						return result;
					}
					if (this.int_5 > 65274)
					{
						this.method_2();
					}
					int num;
					if (this.int_6 >= 3 && (num = this.method_1()) != 0 && this.deflateStrategy_0 != DeflateStrategy.HuffmanOnly && this.int_5 - num <= 32506 && this.method_3(num))
					{
						bool flag = this.deflaterHuffman_0.TallyDist(this.int_5 - this.int_2, this.int_3);
						this.int_6 -= this.int_3;
						if (this.int_3 <= this.int_8 && this.int_6 >= 3)
						{
							while (--this.int_3 > 0)
							{
								this.int_5++;
								this.method_1();
							}
							this.int_5++;
						}
						else
						{
							this.int_5 += this.int_3;
							if (this.int_6 >= 2)
							{
								this.method_0();
							}
						}
						this.int_3 = 2;
						if (!flag)
						{
							continue;
						}
					}
					else
					{
						this.deflaterHuffman_0.TallyLit((int)(this.byte_0[this.int_5] & 255));
						this.int_5++;
						this.int_6--;
					}
					if (this.deflaterHuffman_0.IsFull())
					{
						bool flag2 = bool_2 && this.int_6 == 0;
						this.deflaterHuffman_0.FlushBlock(this.byte_0, this.int_4, this.int_5 - this.int_4, flag2);
						this.int_4 = this.int_5;
						result = !flag2;
						return result;
					}
				}
				result = true;
			}
			return result;
		}
		private bool method_6(bool bool_1, bool bool_2)
		{
			bool result;
			if (this.int_6 < 262 && !bool_1)
			{
				result = false;
			}
			else
			{
				while (this.int_6 >= 262 || bool_1)
				{
					if (this.int_6 == 0)
					{
						if (this.bool_0)
						{
							this.deflaterHuffman_0.TallyLit((int)(this.byte_0[this.int_5 - 1] & 255));
						}
						this.bool_0 = false;
						this.deflaterHuffman_0.FlushBlock(this.byte_0, this.int_4, this.int_5 - this.int_4, bool_2);
						this.int_4 = this.int_5;
						result = false;
						return result;
					}
					if (this.int_5 >= 65274)
					{
						this.method_2();
					}
					int num = this.int_2;
					int num2 = this.int_3;
					if (this.int_6 >= 3)
					{
						int num3 = this.method_1();
						if (this.deflateStrategy_0 != DeflateStrategy.HuffmanOnly && num3 != 0 && this.int_5 - num3 <= 32506 && this.method_3(num3) && this.int_3 <= 5 && (this.deflateStrategy_0 == DeflateStrategy.Filtered || (this.int_3 == 3 && this.int_5 - this.int_2 > 4096)))
						{
							this.int_3 = 2;
						}
					}
					if (num2 >= 3 && this.int_3 <= num2)
					{
						this.deflaterHuffman_0.TallyDist(this.int_5 - 1 - num, num2);
						num2 -= 2;
						do
						{
							this.int_5++;
							this.int_6--;
							if (this.int_6 >= 3)
							{
								this.method_1();
							}
						}
						while (--num2 > 0);
						this.int_5++;
						this.int_6--;
						this.bool_0 = false;
						this.int_3 = 2;
					}
					else
					{
						if (this.bool_0)
						{
							this.deflaterHuffman_0.TallyLit((int)(this.byte_0[this.int_5 - 1] & 255));
						}
						this.bool_0 = true;
						this.int_5++;
						this.int_6--;
					}
					if (this.deflaterHuffman_0.IsFull())
					{
						int num4 = this.int_5 - this.int_4;
						if (this.bool_0)
						{
							num4--;
						}
						bool flag = bool_2 && this.int_6 == 0 && !this.bool_0;
						this.deflaterHuffman_0.FlushBlock(this.byte_0, this.int_4, num4, flag);
						this.int_4 += num4;
						result = !flag;
						return result;
					}
				}
				result = true;
			}
			return result;
		}
	}
	public class DeflaterHuffman
	{
		private class Class42
		{
			public short[] short_0;
			public byte[] byte_0;
			public int int_0;
			public int int_1;
			private short[] short_1;
			private int[] int_2;
			private int int_3;
			private DeflaterHuffman deflaterHuffman_0;
			public Class42(DeflaterHuffman deflaterHuffman_1, int int_4, int int_5, int int_6)
			{
				this.deflaterHuffman_0 = deflaterHuffman_1;
				this.int_0 = int_5;
				this.int_3 = int_6;
				this.short_0 = new short[int_4];
				this.int_2 = new int[int_6];
			}
			public void method_0()
			{
				for (int i = 0; i < this.short_0.Length; i++)
				{
					this.short_0[i] = 0;
				}
				this.short_1 = null;
				this.byte_0 = null;
			}
			public void method_1(int int_4)
			{
				this.deflaterHuffman_0.pending.WriteBits((int)this.short_1[int_4] & 65535, (int)this.byte_0[int_4]);
			}
			public void method_2()
			{
				bool flag = true;
				for (int i = 0; i < this.short_0.Length; i++)
				{
					if (this.short_0[i] != 0)
					{
						flag = false;
					}
				}
				if (!flag)
				{
					throw new SharpZipBaseException("!Empty");
				}
			}
			public void method_3(short[] short_2, byte[] byte_1)
			{
				this.short_1 = short_2;
				this.byte_0 = byte_1;
			}
			public void method_4()
			{
				int[] array = new int[this.int_3];
				int num = 0;
				this.short_1 = new short[this.short_0.Length];
				for (int i = 0; i < this.int_3; i++)
				{
					array[i] = num;
					num += this.int_2[i] << 15 - i;
				}
				for (int j = 0; j < this.int_1; j++)
				{
					int i = (int)this.byte_0[j];
					if (i > 0)
					{
						this.short_1[j] = DeflaterHuffman.BitReverse(array[i - 1]);
						array[i - 1] += 1 << 16 - i;
					}
				}
			}
			public void method_5()
			{
				int num = this.short_0.Length;
				int[] array = new int[num];
				int i = 0;
				int num2 = 0;
				for (int j = 0; j < num; j++)
				{
					int num3 = (int)this.short_0[j];
					if (num3 != 0)
					{
						int num4 = i++;
						int num5;
						while (num4 > 0 && (int)this.short_0[array[num5 = (num4 - 1) / 2]] > num3)
						{
							array[num4] = array[num5];
							num4 = num5;
						}
						array[num4] = j;
						num2 = j;
					}
				}
				while (i < 2)
				{
					int num6 = (num2 < 2) ? (++num2) : 0;
					array[i++] = num6;
				}
				this.int_1 = Math.Max(num2 + 1, this.int_0);
				int num7 = i;
				int[] array2 = new int[4 * i - 2];
				int[] array3 = new int[2 * i - 1];
				int num8 = num7;
				for (int k = 0; k < i; k++)
				{
					int num6 = array[k];
					array2[2 * k] = num6;
					array2[2 * k + 1] = -1;
					array3[k] = (int)this.short_0[num6] << 8;
					array[k] = k;
				}
				do
				{
					int num9 = array[0];
					int num10 = array[--i];
					int num5 = 0;
					int l;
					for (l = 1; l < i; l = l * 2 + 1)
					{
						if (l + 1 < i && array3[array[l]] > array3[array[l + 1]])
						{
							l++;
						}
						array[num5] = array[l];
						num5 = l;
					}
					int num11 = array3[num10];
					while ((l = num5) > 0 && array3[array[num5 = (l - 1) / 2]] > num11)
					{
						array[l] = array[num5];
					}
					array[l] = num10;
					int num12 = array[0];
					num10 = num8++;
					array2[2 * num10] = num9;
					array2[2 * num10 + 1] = num12;
					int num13 = Math.Min(array3[num9] & 255, array3[num12] & 255);
					num11 = (array3[num10] = array3[num9] + array3[num12] - num13 + 1);
					num5 = 0;
					for (l = 1; l < i; l = num5 * 2 + 1)
					{
						if (l + 1 < i && array3[array[l]] > array3[array[l + 1]])
						{
							l++;
						}
						array[num5] = array[l];
						num5 = l;
					}
					while ((l = num5) > 0 && array3[array[num5 = (l - 1) / 2]] > num11)
					{
						array[l] = array[num5];
					}
					array[l] = num10;
				}
				while (i > 1);
				if (array[0] != array2.Length / 2 - 1)
				{
					throw new SharpZipBaseException("Heap invariant violated");
				}
				this.method_9(array2);
			}
			public int method_6()
			{
				int num = 0;
				for (int i = 0; i < this.short_0.Length; i++)
				{
					num += (int)(this.short_0[i] * (short)this.byte_0[i]);
				}
				return num;
			}
			public void method_7(DeflaterHuffman.Class42 class42_0)
			{
				int num = -1;
				int i = 0;
				while (i < this.int_1)
				{
					int num2 = 1;
					int num3 = (int)this.byte_0[i];
					int num4;
					int num5;
					if (num3 == 0)
					{
						num4 = 138;
						num5 = 3;
					}
					else
					{
						num4 = 6;
						num5 = 3;
						if (num != num3)
						{
							short[] expr_41_cp_0 = class42_0.short_0;
							int expr_41_cp_1 = num3;
							expr_41_cp_0[expr_41_cp_1] += 1;
							num2 = 0;
						}
					}
					num = num3;
					i++;
					while (i < this.int_1 && num == (int)this.byte_0[i])
					{
						i++;
						if (++num2 >= num4)
						{
							break;
						}
					}
					if (num2 < num5)
					{
						short[] expr_9B_cp_0 = class42_0.short_0;
						int expr_9B_cp_1 = num;
						expr_9B_cp_0[expr_9B_cp_1] += (short)num2;
					}
					else
					{
						if (num != 0)
						{
							short[] expr_BF_cp_0 = class42_0.short_0;
							int expr_BF_cp_1 = 16;
							expr_BF_cp_0[expr_BF_cp_1] += 1;
						}
						else
						{
							if (num2 <= 10)
							{
								short[] expr_E3_cp_0 = class42_0.short_0;
								int expr_E3_cp_1 = 17;
								expr_E3_cp_0[expr_E3_cp_1] += 1;
							}
							else
							{
								short[] expr_100_cp_0 = class42_0.short_0;
								int expr_100_cp_1 = 18;
								expr_100_cp_0[expr_100_cp_1] += 1;
							}
						}
					}
				}
			}
			public void method_8(DeflaterHuffman.Class42 class42_0)
			{
				int num = -1;
				int i = 0;
				while (i < this.int_1)
				{
					int num2 = 1;
					int num3 = (int)this.byte_0[i];
					int num4;
					int num5;
					if (num3 == 0)
					{
						num4 = 138;
						num5 = 3;
					}
					else
					{
						num4 = 6;
						num5 = 3;
						if (num != num3)
						{
							class42_0.method_1(num3);
							num2 = 0;
						}
					}
					num = num3;
					i++;
					while (i < this.int_1 && num == (int)this.byte_0[i])
					{
						i++;
						if (++num2 >= num4)
						{
							break;
						}
					}
					if (num2 < num5)
					{
						while (num2-- > 0)
						{
							class42_0.method_1(num);
						}
					}
					else
					{
						if (num != 0)
						{
							class42_0.method_1(16);
							this.deflaterHuffman_0.pending.WriteBits(num2 - 3, 2);
						}
						else
						{
							if (num2 <= 10)
							{
								class42_0.method_1(17);
								this.deflaterHuffman_0.pending.WriteBits(num2 - 3, 3);
							}
							else
							{
								class42_0.method_1(18);
								this.deflaterHuffman_0.pending.WriteBits(num2 - 11, 7);
							}
						}
					}
				}
			}
			private void method_9(int[] int_4)
			{
				this.byte_0 = new byte[this.short_0.Length];
				int num = int_4.Length / 2;
				int num2 = (num + 1) / 2;
				int num3 = 0;
				for (int i = 0; i < this.int_3; i++)
				{
					this.int_2[i] = 0;
				}
				int[] array = new int[num];
				array[num - 1] = 0;
				for (int i = num - 1; i >= 0; i--)
				{
					if (int_4[2 * i + 1] != -1)
					{
						int num4 = array[i] + 1;
						if (num4 > this.int_3)
						{
							num4 = this.int_3;
							num3++;
						}
						array[int_4[2 * i]] = (array[int_4[2 * i + 1]] = num4);
					}
					else
					{
						int num4 = array[i];
						this.int_2[num4 - 1]++;
						this.byte_0[int_4[2 * i]] = (byte)array[i];
					}
				}
				if (num3 != 0)
				{
					int num5 = this.int_3 - 1;
					while (true)
					{
						if (this.int_2[--num5] != 0)
						{
							do
							{
								this.int_2[num5]--;
								this.int_2[++num5]++;
								num3 -= 1 << this.int_3 - 1 - num5;
							}
							while (num3 > 0 && num5 < this.int_3 - 1);
							if (num3 <= 0)
							{
								break;
							}
						}
					}
					this.int_2[this.int_3 - 1] += num3;
					this.int_2[this.int_3 - 2] -= num3;
					int num6 = 2 * num2;
					for (int num7 = this.int_3; num7 != 0; num7--)
					{
						int j = this.int_2[num7 - 1];
						while (j > 0)
						{
							int num8 = 2 * int_4[num6++];
							if (int_4[num8 + 1] == -1)
							{
								this.byte_0[int_4[num8]] = (byte)num7;
								j--;
							}
						}
					}
				}
			}
		}
		private const int int_0 = 16384;
		private const int int_1 = 286;
		private const int int_2 = 30;
		private const int int_3 = 19;
		private const int int_4 = 16;
		private const int int_5 = 17;
		private const int int_6 = 18;
		private const int int_7 = 256;
		private static readonly int[] int_8;
		private static readonly byte[] byte_0;
		private static short[] short_0;
		private static byte[] byte_1;
		private static short[] short_1;
		private static byte[] byte_2;
		public DeflaterPending pending;
		private DeflaterHuffman.Class42 class42_0;
		private DeflaterHuffman.Class42 class42_1;
		private DeflaterHuffman.Class42 class42_2;
		private short[] short_2;
		private byte[] byte_3;
		private int int_9;
		private int int_10;
		static DeflaterHuffman()
		{
			DeflaterHuffman.int_8 = new int[]
			{
				16,
				17,
				18,
				0,
				8,
				7,
				9,
				6,
				10,
				5,
				11,
				4,
				12,
				3,
				13,
				2,
				14,
				1,
				15
			};
			DeflaterHuffman.byte_0 = new byte[]
			{
				0,
				8,
				4,
				12,
				2,
				10,
				6,
				14,
				1,
				9,
				5,
				13,
				3,
				11,
				7,
				15
			};
			DeflaterHuffman.short_0 = new short[286];
			DeflaterHuffman.byte_1 = new byte[286];
			int i = 0;
			while (i < 144)
			{
				DeflaterHuffman.short_0[i] = DeflaterHuffman.BitReverse(48 + i << 8);
				DeflaterHuffman.byte_1[i++] = 8;
			}
			while (i < 256)
			{
				DeflaterHuffman.short_0[i] = DeflaterHuffman.BitReverse(256 + i << 7);
				DeflaterHuffman.byte_1[i++] = 9;
			}
			while (i < 280)
			{
				DeflaterHuffman.short_0[i] = DeflaterHuffman.BitReverse(-256 + i << 9);
				DeflaterHuffman.byte_1[i++] = 7;
			}
			while (i < 286)
			{
				DeflaterHuffman.short_0[i] = DeflaterHuffman.BitReverse(-88 + i << 8);
				DeflaterHuffman.byte_1[i++] = 8;
			}
			DeflaterHuffman.short_1 = new short[30];
			DeflaterHuffman.byte_2 = new byte[30];
			for (i = 0; i < 30; i++)
			{
				DeflaterHuffman.short_1[i] = DeflaterHuffman.BitReverse(i << 11);
				DeflaterHuffman.byte_2[i] = 5;
			}
		}
		public DeflaterHuffman(DeflaterPending pending)
		{
			this.pending = pending;
			this.class42_0 = new DeflaterHuffman.Class42(this, 286, 257, 15);
			this.class42_1 = new DeflaterHuffman.Class42(this, 30, 1, 15);
			this.class42_2 = new DeflaterHuffman.Class42(this, 19, 4, 7);
			this.short_2 = new short[16384];
			this.byte_3 = new byte[16384];
		}
		public void Reset()
		{
			this.int_9 = 0;
			this.int_10 = 0;
			this.class42_0.method_0();
			this.class42_1.method_0();
			this.class42_2.method_0();
		}
		public void SendAllTrees(int blTreeCodes)
		{
			this.class42_2.method_4();
			this.class42_0.method_4();
			this.class42_1.method_4();
			this.pending.WriteBits(this.class42_0.int_1 - 257, 5);
			this.pending.WriteBits(this.class42_1.int_1 - 1, 5);
			this.pending.WriteBits(blTreeCodes - 4, 4);
			for (int i = 0; i < blTreeCodes; i++)
			{
				this.pending.WriteBits((int)this.class42_2.byte_0[DeflaterHuffman.int_8[i]], 3);
			}
			this.class42_0.method_8(this.class42_2);
			this.class42_1.method_8(this.class42_2);
		}
		public void CompressBlock()
		{
			for (int i = 0; i < this.int_9; i++)
			{
				int num = (int)(this.byte_3[i] & 255);
				int num2 = (int)this.short_2[i];
				if (num2-- != 0)
				{
					int num3 = DeflaterHuffman.smethod_0(num);
					this.class42_0.method_1(num3);
					int num4 = (num3 - 261) / 4;
					if (num4 > 0 && num4 <= 5)
					{
						this.pending.WriteBits(num & (1 << num4) - 1, num4);
					}
					int num5 = DeflaterHuffman.smethod_1(num2);
					this.class42_1.method_1(num5);
					num4 = num5 / 2 - 1;
					if (num4 > 0)
					{
						this.pending.WriteBits(num2 & (1 << num4) - 1, num4);
					}
				}
				else
				{
					this.class42_0.method_1(num);
				}
			}
			this.class42_0.method_1(256);
		}
		public void FlushStoredBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock)
		{
			this.pending.WriteBits(lastBlock ? 1 : 0, 3);
			this.pending.AlignToByte();
			this.pending.WriteShort(storedLength);
			this.pending.WriteShort(~storedLength);
			this.pending.WriteBlock(stored, storedOffset, storedLength);
			this.Reset();
		}
		public void FlushBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock)
		{
			short[] expr_15_cp_0 = this.class42_0.short_0;
			int expr_15_cp_1 = 256;
			expr_15_cp_0[expr_15_cp_1] += 1;
			this.class42_0.method_5();
			this.class42_1.method_5();
			this.class42_0.method_7(this.class42_2);
			this.class42_1.method_7(this.class42_2);
			this.class42_2.method_5();
			int num = 4;
			for (int i = 18; i > num; i--)
			{
				if (this.class42_2.byte_0[DeflaterHuffman.int_8[i]] > 0)
				{
					num = i + 1;
				}
			}
			int num2 = 14 + num * 3 + this.class42_2.method_6() + this.class42_0.method_6() + this.class42_1.method_6() + this.int_10;
			int num3 = this.int_10;
			for (int i = 0; i < 286; i++)
			{
				num3 += (int)(this.class42_0.short_0[i] * (short)DeflaterHuffman.byte_1[i]);
			}
			for (int i = 0; i < 30; i++)
			{
				num3 += (int)(this.class42_1.short_0[i] * (short)DeflaterHuffman.byte_2[i]);
			}
			if (num2 >= num3)
			{
				num2 = num3;
			}
			if (storedOffset >= 0 && storedLength + 4 < num2 >> 3)
			{
				this.FlushStoredBlock(stored, storedOffset, storedLength, lastBlock);
			}
			else
			{
				if (num2 == num3)
				{
					this.pending.WriteBits(2 + (lastBlock ? 1 : 0), 3);
					this.class42_0.method_3(DeflaterHuffman.short_0, DeflaterHuffman.byte_1);
					this.class42_1.method_3(DeflaterHuffman.short_1, DeflaterHuffman.byte_2);
					this.CompressBlock();
					this.Reset();
				}
				else
				{
					this.pending.WriteBits(4 + (lastBlock ? 1 : 0), 3);
					this.SendAllTrees(num);
					this.CompressBlock();
					this.Reset();
				}
			}
		}
		public bool IsFull()
		{
			return this.int_9 >= 16384;
		}
		public bool TallyLit(int literal)
		{
			this.short_2[this.int_9] = 0;
			this.byte_3[this.int_9++] = (byte)literal;
			short[] expr_39_cp_0 = this.class42_0.short_0;
			expr_39_cp_0[literal] += 1;
			return this.IsFull();
		}
		public bool TallyDist(int distance, int length)
		{
			this.short_2[this.int_9] = (short)distance;
			this.byte_3[this.int_9++] = (byte)(length - 3);
			int num = DeflaterHuffman.smethod_0(length - 3);
			short[] expr_45_cp_0 = this.class42_0.short_0;
			int expr_45_cp_1 = num;
			expr_45_cp_0[expr_45_cp_1] += 1;
			if (num >= 265 && num < 285)
			{
				this.int_10 += (num - 261) / 4;
			}
			int num2 = DeflaterHuffman.smethod_1(distance - 1);
			short[] expr_9B_cp_0 = this.class42_1.short_0;
			int expr_9B_cp_1 = num2;
			expr_9B_cp_0[expr_9B_cp_1] += 1;
			if (num2 >= 4)
			{
				this.int_10 += num2 / 2 - 1;
			}
			return this.IsFull();
		}
		public static short BitReverse(int toReverse)
		{
			return (short)((int)DeflaterHuffman.byte_0[toReverse & 15] << 12 | (int)DeflaterHuffman.byte_0[toReverse >> 4 & 15] << 8 | (int)DeflaterHuffman.byte_0[toReverse >> 8 & 15] << 4 | (int)DeflaterHuffman.byte_0[toReverse >> 12]);
		}
		private static int smethod_0(int int_11)
		{
			int result;
			if (int_11 == 255)
			{
				result = 285;
			}
			else
			{
				int num = 257;
				while (int_11 >= 8)
				{
					num += 4;
					int_11 >>= 1;
				}
				result = num + int_11;
			}
			return result;
		}
		private static int smethod_1(int int_11)
		{
			int num = 0;
			while (int_11 >= 4)
			{
				num += 2;
				int_11 >>= 1;
			}
			return num + int_11;
		}
	}
	public class PendingBuffer
	{
		private byte[] byte_0;
		private int int_0;
		private int int_1;
		private uint uint_0;
		private int int_2;
		public int BitCount
		{
			get
			{
				return this.int_2;
			}
		}
		public bool IsFlushed
		{
			get
			{
				return this.int_1 == 0;
			}
		}
		public PendingBuffer() : this(4096)
		{
		}
		public PendingBuffer(int bufferSize)
		{
			this.byte_0 = new byte[bufferSize];
		}
		public void Reset()
		{
			this.int_2 = 0;
			this.int_1 = 0;
			this.int_0 = 0;
		}
		public void WriteByte(int value)
		{
			this.byte_0[this.int_1++] = (byte)value;
		}
		public void WriteShort(int value)
		{
			this.byte_0[this.int_1++] = (byte)value;
			this.byte_0[this.int_1++] = (byte)(value >> 8);
		}
		public void WriteInt(int value)
		{
			this.byte_0[this.int_1++] = (byte)value;
			this.byte_0[this.int_1++] = (byte)(value >> 8);
			this.byte_0[this.int_1++] = (byte)(value >> 16);
			this.byte_0[this.int_1++] = (byte)(value >> 24);
		}
		public void WriteBlock(byte[] block, int offset, int length)
		{
			Array.Copy(block, offset, this.byte_0, this.int_1, length);
			this.int_1 += length;
		}
		public void AlignToByte()
		{
			if (this.int_2 > 0)
			{
				this.byte_0[this.int_1++] = (byte)this.uint_0;
				if (this.int_2 > 8)
				{
					this.byte_0[this.int_1++] = (byte)(this.uint_0 >> 8);
				}
			}
			this.uint_0 = 0u;
			this.int_2 = 0;
		}
		public void WriteBits(int int_3, int count)
		{
			this.uint_0 |= (uint)((uint)int_3 << this.int_2);
			this.int_2 += count;
			if (this.int_2 >= 16)
			{
				this.byte_0[this.int_1++] = (byte)this.uint_0;
				this.byte_0[this.int_1++] = (byte)(this.uint_0 >> 8);
				this.uint_0 >>= 16;
				this.int_2 -= 16;
			}
		}
		public void WriteShortMSB(int int_3)
		{
			this.byte_0[this.int_1++] = (byte)(int_3 >> 8);
			this.byte_0[this.int_1++] = (byte)int_3;
		}
		public int Flush(byte[] output, int offset, int length)
		{
			if (this.int_2 >= 8)
			{
				this.byte_0[this.int_1++] = (byte)this.uint_0;
				this.uint_0 >>= 8;
				this.int_2 -= 8;
			}
			if (length > this.int_1 - this.int_0)
			{
				length = this.int_1 - this.int_0;
				Array.Copy(this.byte_0, this.int_0, output, offset, length);
				this.int_0 = 0;
				this.int_1 = 0;
			}
			else
			{
				Array.Copy(this.byte_0, this.int_0, output, offset, length);
				this.int_0 += length;
			}
			return length;
		}
		public byte[] ToByteArray()
		{
			byte[] array = new byte[this.int_1 - this.int_0];
			Array.Copy(this.byte_0, this.int_0, array, 0, array.Length);
			this.int_0 = 0;
			this.int_1 = 0;
			return array;
		}
	}
	public class DeflaterPending : PendingBuffer
	{
		public DeflaterPending() : base(65536)
		{
		}
	}
	public class Inflater
	{
		private const int int_0 = 0;
		private const int int_1 = 1;
		private const int int_2 = 2;
		private const int int_3 = 3;
		private const int int_4 = 4;
		private const int int_5 = 5;
		private const int int_6 = 6;
		private const int int_7 = 7;
		private const int int_8 = 8;
		private const int int_9 = 9;
		private const int int_10 = 10;
		private const int int_11 = 11;
		private const int int_12 = 12;
		private static readonly int[] int_13 = new int[]
		{
			3,
			4,
			5,
			6,
			7,
			8,
			9,
			10,
			11,
			13,
			15,
			17,
			19,
			23,
			27,
			31,
			35,
			43,
			51,
			59,
			67,
			83,
			99,
			115,
			131,
			163,
			195,
			227,
			258
		};
		private static readonly int[] int_14 = new int[]
		{
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			1,
			1,
			1,
			1,
			2,
			2,
			2,
			2,
			3,
			3,
			3,
			3,
			4,
			4,
			4,
			4,
			5,
			5,
			5,
			5,
			0
		};
		private static readonly int[] int_15 = new int[]
		{
			1,
			2,
			3,
			4,
			5,
			7,
			9,
			13,
			17,
			25,
			33,
			49,
			65,
			97,
			129,
			193,
			257,
			385,
			513,
			769,
			1025,
			1537,
			2049,
			3073,
			4097,
			6145,
			8193,
			12289,
			16385,
			24577
		};
		private static readonly int[] int_16 = new int[]
		{
			0,
			0,
			0,
			0,
			1,
			1,
			2,
			2,
			3,
			3,
			4,
			4,
			5,
			5,
			6,
			6,
			7,
			7,
			8,
			8,
			9,
			9,
			10,
			10,
			11,
			11,
			12,
			12,
			13,
			13
		};
		private int int_17;
		private int int_18;
		private int int_19;
		private int int_20;
		private int int_21;
		private int int_22;
		private bool bool_0;
		private long long_0;
		private long long_1;
		private bool bool_1;
		private StreamManipulator streamManipulator_0;
		private OutputWindow outputWindow_0;
		private Class43 class43_0;
		private InflaterHuffmanTree inflaterHuffmanTree_0;
		private InflaterHuffmanTree inflaterHuffmanTree_1;
		private Adler32 adler32_0;
		public bool IsNeedingInput
		{
			get
			{
				return this.streamManipulator_0.IsNeedingInput;
			}
		}
		public bool IsNeedingDictionary
		{
			get
			{
				return this.int_17 == 1 && this.int_19 == 0;
			}
		}
		public bool IsFinished
		{
			get
			{
				return this.int_17 == 12 && this.outputWindow_0.GetAvailable() == 0;
			}
		}
		public int Adler
		{
			get
			{
				return this.IsNeedingDictionary ? this.int_18 : ((int)this.adler32_0.Value);
			}
		}
		public long TotalOut
		{
			get
			{
				return this.long_0;
			}
		}
		public long TotalIn
		{
			get
			{
				return this.long_1 - (long)this.RemainingInput;
			}
		}
		public int RemainingInput
		{
			get
			{
				return this.streamManipulator_0.AvailableBytes;
			}
		}
		public Inflater() : this(false)
		{
		}
		public Inflater(bool noHeader)
		{
			this.bool_1 = noHeader;
			this.adler32_0 = new Adler32();
			this.streamManipulator_0 = new StreamManipulator();
			this.outputWindow_0 = new OutputWindow();
			this.int_17 = (noHeader ? 2 : 0);
		}
		public void Reset()
		{
			this.int_17 = (this.bool_1 ? 2 : 0);
			this.long_1 = 0L;
			this.long_0 = 0L;
			this.streamManipulator_0.Reset();
			this.outputWindow_0.Reset();
			this.class43_0 = null;
			this.inflaterHuffmanTree_0 = null;
			this.inflaterHuffmanTree_1 = null;
			this.bool_0 = false;
			this.adler32_0.Reset();
		}
		private bool method_0()
		{
			int num = this.streamManipulator_0.PeekBits(16);
			bool result;
			if (num < 0)
			{
				result = false;
			}
			else
			{
				this.streamManipulator_0.DropBits(16);
				num = ((num << 8 | num >> 8) & 65535);
				if (num % 31 != 0)
				{
					throw new SharpZipBaseException("Header checksum illegal");
				}
				if ((num & 3840) != 2048)
				{
					throw new SharpZipBaseException("Compression Method unknown");
				}
				if ((num & 32) == 0)
				{
					this.int_17 = 2;
				}
				else
				{
					this.int_17 = 1;
					this.int_19 = 32;
				}
				result = true;
			}
			return result;
		}
		private bool method_1()
		{
			bool result;
			while (this.int_19 > 0)
			{
				int num = this.streamManipulator_0.PeekBits(8);
				if (num < 0)
				{
					result = false;
					return result;
				}
				this.streamManipulator_0.DropBits(8);
				this.int_18 = (this.int_18 << 8 | num);
				this.int_19 -= 8;
			}
			result = false;
			return result;
		}
		private bool method_2()
		{
			int i = this.outputWindow_0.GetFreeSpace();
			bool result;
			while (i >= 258)
			{
				int symbol;
				switch (this.int_17)
				{
				case 7:
					while (((symbol = this.inflaterHuffmanTree_0.GetSymbol(this.streamManipulator_0)) & -256) == 0)
					{
						this.outputWindow_0.Write(symbol);
						if (--i < 258)
						{
							result = true;
							return result;
						}
					}
					if (symbol >= 257)
					{
						try
						{
							this.int_20 = Inflater.int_13[symbol - 257];
							this.int_19 = Inflater.int_14[symbol - 257];
						}
						catch (Exception)
						{
							throw new SharpZipBaseException("Illegal rep length code");
						}
						goto IL_BF;
					}
					if (symbol < 0)
					{
						result = false;
						return result;
					}
					this.inflaterHuffmanTree_1 = null;
					this.inflaterHuffmanTree_0 = null;
					this.int_17 = 2;
					result = true;
					return result;
				case 8:
					goto IL_BF;
				case 9:
					goto IL_119;
				case 10:
					break;
				default:
					throw new SharpZipBaseException("Inflater unknown mode");
				}
				IL_15F:
				if (this.int_19 > 0)
				{
					this.int_17 = 10;
					int num = this.streamManipulator_0.PeekBits(this.int_19);
					if (num < 0)
					{
						result = false;
						return result;
					}
					this.streamManipulator_0.DropBits(this.int_19);
					this.int_21 += num;
				}
				this.outputWindow_0.Repeat(this.int_20, this.int_21);
				i -= this.int_20;
				this.int_17 = 7;
				continue;
				IL_119:
				symbol = this.inflaterHuffmanTree_1.GetSymbol(this.streamManipulator_0);
				if (symbol >= 0)
				{
					try
					{
						this.int_21 = Inflater.int_15[symbol];
						this.int_19 = Inflater.int_16[symbol];
					}
					catch (Exception)
					{
						throw new SharpZipBaseException("Illegal rep dist code");
					}
					goto IL_15F;
				}
				result = false;
				return result;
				IL_BF:
				if (this.int_19 > 0)
				{
					this.int_17 = 8;
					int num = this.streamManipulator_0.PeekBits(this.int_19);
					if (num < 0)
					{
						result = false;
						return result;
					}
					this.streamManipulator_0.DropBits(this.int_19);
					this.int_20 += num;
				}
				this.int_17 = 9;
				goto IL_119;
			}
			result = true;
			return result;
		}
		private bool method_3()
		{
			bool result;
			while (this.int_19 > 0)
			{
				int num = this.streamManipulator_0.PeekBits(8);
				if (num < 0)
				{
					result = false;
					return result;
				}
				this.streamManipulator_0.DropBits(8);
				this.int_18 = (this.int_18 << 8 | num);
				this.int_19 -= 8;
			}
			if ((int)this.adler32_0.Value != this.int_18)
			{
				throw new SharpZipBaseException(string.Concat(new object[]
				{
					"Adler chksum doesn't match: ",
					(int)this.adler32_0.Value,
					" vs. ",
					this.int_18
				}));
			}
			this.int_17 = 12;
			result = false;
			return result;
		}
		private bool method_4()
		{
			bool result;
			switch (this.int_17)
			{
			case 0:
				result = this.method_0();
				return result;
			case 1:
				result = this.method_1();
				return result;
			case 2:
				if (this.bool_0)
				{
					if (this.bool_1)
					{
						this.int_17 = 12;
						result = false;
						return result;
					}
					this.streamManipulator_0.SkipToByteBoundary();
					this.int_19 = 32;
					this.int_17 = 11;
					result = true;
					return result;
				}
				else
				{
					int num = this.streamManipulator_0.PeekBits(3);
					if (num < 0)
					{
						result = false;
						return result;
					}
					this.streamManipulator_0.DropBits(3);
					if ((num & 1) != 0)
					{
						this.bool_0 = true;
					}
					switch (num >> 1)
					{
					case 0:
						this.streamManipulator_0.SkipToByteBoundary();
						this.int_17 = 3;
						break;
					case 1:
						this.inflaterHuffmanTree_0 = InflaterHuffmanTree.defLitLenTree;
						this.inflaterHuffmanTree_1 = InflaterHuffmanTree.defDistTree;
						this.int_17 = 7;
						break;
					case 2:
						this.class43_0 = new Class43();
						this.int_17 = 6;
						break;
					default:
						throw new SharpZipBaseException("Unknown block type " + num);
					}
					result = true;
					return result;
				}
				break;
			case 3:
				if ((this.int_22 = this.streamManipulator_0.PeekBits(16)) < 0)
				{
					result = false;
					return result;
				}
				this.streamManipulator_0.DropBits(16);
				this.int_17 = 4;
				break;
			case 4:
				break;
			case 5:
				goto IL_1EF;
			case 6:
				if (!this.class43_0.method_0(this.streamManipulator_0))
				{
					result = false;
					return result;
				}
				this.inflaterHuffmanTree_0 = this.class43_0.method_1();
				this.inflaterHuffmanTree_1 = this.class43_0.method_2();
				this.int_17 = 7;
				goto IL_281;
			case 7:
			case 8:
			case 9:
			case 10:
				goto IL_281;
			case 11:
				result = this.method_3();
				return result;
			case 12:
				result = false;
				return result;
			default:
				throw new SharpZipBaseException("Inflater.Decode unknown mode");
			}
			int num2 = this.streamManipulator_0.PeekBits(16);
			if (num2 < 0)
			{
				result = false;
				return result;
			}
			this.streamManipulator_0.DropBits(16);
			if (num2 != (this.int_22 ^ 65535))
			{
				throw new SharpZipBaseException("broken uncompressed block");
			}
			this.int_17 = 5;
			IL_1EF:
			int num3 = this.outputWindow_0.CopyStored(this.streamManipulator_0, this.int_22);
			this.int_22 -= num3;
			if (this.int_22 == 0)
			{
				this.int_17 = 2;
				result = true;
				return result;
			}
			result = !this.streamManipulator_0.IsNeedingInput;
			return result;
			IL_281:
			result = this.method_2();
			return result;
		}
		public void SetDictionary(byte[] buffer)
		{
			this.SetDictionary(buffer, 0, buffer.Length);
		}
		public void SetDictionary(byte[] buffer, int index, int count)
		{
			if (buffer == null)
			{
				throw new ArgumentNullException("buffer");
			}
			if (index < 0)
			{
				throw new ArgumentOutOfRangeException("index");
			}
			if (count < 0)
			{
				throw new ArgumentOutOfRangeException("count");
			}
			if (!this.IsNeedingDictionary)
			{
				throw new InvalidOperationException("Dictionary is not needed");
			}
			this.adler32_0.Update(buffer, index, count);
			if ((int)this.adler32_0.Value != this.int_18)
			{
				throw new SharpZipBaseException("Wrong adler checksum");
			}
			this.adler32_0.Reset();
			this.outputWindow_0.CopyDict(buffer, index, count);
			this.int_17 = 2;
		}
		public void SetInput(byte[] buffer)
		{
			this.SetInput(buffer, 0, buffer.Length);
		}
		public void SetInput(byte[] buffer, int index, int count)
		{
			this.streamManipulator_0.SetInput(buffer, index, count);
			this.long_1 += (long)count;
		}
		public int Inflate(byte[] buffer)
		{
			if (buffer == null)
			{
				throw new ArgumentNullException("buffer");
			}
			return this.Inflate(buffer, 0, buffer.Length);
		}
		public int Inflate(byte[] buffer, int offset, int count)
		{
			if (buffer == null)
			{
				throw new ArgumentNullException("buffer");
			}
			if (count < 0)
			{
				throw new ArgumentOutOfRangeException("count", "count cannot be negative");
			}
			if (offset < 0)
			{
				throw new ArgumentOutOfRangeException("offset", "offset cannot be negative");
			}
			if (offset + count > buffer.Length)
			{
				throw new ArgumentException("count exceeds buffer bounds");
			}
			int result;
			if (count == 0)
			{
				if (!this.IsFinished)
				{
					this.method_4();
				}
				result = 0;
			}
			else
			{
				int num = 0;
				do
				{
					if (this.int_17 != 11)
					{
						int num2 = this.outputWindow_0.CopyOutput(buffer, offset, count);
						if (num2 > 0)
						{
							this.adler32_0.Update(buffer, offset, num2);
							offset += num2;
							num += num2;
							this.long_0 += (long)num2;
							count -= num2;
							if (count == 0)
							{
								goto Block_11;
							}
						}
					}
				}
				while (this.method_4() || (this.outputWindow_0.GetAvailable() > 0 && this.int_17 != 11));
				result = num;
				return result;
				Block_11:
				result = num;
			}
			return result;
		}
	}
	internal class Class43
	{
		private const int int_0 = 0;
		private const int int_1 = 1;
		private const int int_2 = 2;
		private const int int_3 = 3;
		private const int int_4 = 4;
		private const int int_5 = 5;
		private static readonly int[] int_6 = new int[]
		{
			3,
			3,
			11
		};
		private static readonly int[] int_7 = new int[]
		{
			2,
			3,
			7
		};
		private static readonly int[] int_8 = new int[]
		{
			16,
			17,
			18,
			0,
			8,
			7,
			9,
			6,
			10,
			5,
			11,
			4,
			12,
			3,
			13,
			2,
			14,
			1,
			15
		};
		private byte[] byte_0;
		private byte[] byte_1;
		private InflaterHuffmanTree inflaterHuffmanTree_0;
		private int int_9;
		private int int_10;
		private int int_11;
		private int int_12;
		private int int_13;
		private int int_14;
		private byte byte_2;
		private int int_15;
		public bool method_0(StreamManipulator streamManipulator_0)
		{
			while (true)
			{
				switch (this.int_9)
				{
				case 0:
					this.int_10 = streamManipulator_0.PeekBits(5);
					if (this.int_10 >= 0)
					{
						this.int_10 += 257;
						streamManipulator_0.DropBits(5);
						this.int_9 = 1;
						goto IL_20B;
					}
					goto IL_2D6;
				case 1:
					goto IL_20B;
				case 2:
					goto IL_1B8;
				case 3:
					goto IL_17D;
				case 4:
					break;
				case 5:
					goto IL_06;
				default:
					continue;
				}
				IL_E3:
				int symbol;
				while (((symbol = this.inflaterHuffmanTree_0.GetSymbol(streamManipulator_0)) & -16) == 0)
				{
					this.byte_1[this.int_15++] = (this.byte_2 = (byte)symbol);
					if (this.int_15 == this.int_13)
					{
						goto IL_2F0;
					}
				}
				if (symbol >= 0)
				{
					if (symbol >= 17)
					{
						this.byte_2 = 0;
					}
					else
					{
						if (this.int_15 == 0)
						{
							goto IL_2EA;
						}
					}
					this.int_14 = symbol - 16;
					this.int_9 = 5;
					goto IL_06;
				}
				goto IL_2E6;
				IL_17D:
				while (this.int_15 < this.int_12)
				{
					int num = streamManipulator_0.PeekBits(3);
					if (num < 0)
					{
						goto IL_2E2;
					}
					streamManipulator_0.DropBits(3);
					this.byte_0[Class43.int_8[this.int_15]] = (byte)num;
					this.int_15++;
				}
				this.inflaterHuffmanTree_0 = new InflaterHuffmanTree(this.byte_0);
				this.byte_0 = null;
				this.int_15 = 0;
				this.int_9 = 4;
				goto IL_E3;
				IL_06:
				int bitCount = Class43.int_7[this.int_14];
				int num2 = streamManipulator_0.PeekBits(bitCount);
				if (num2 < 0)
				{
					goto IL_2F4;
				}
				streamManipulator_0.DropBits(bitCount);
				num2 += Class43.int_6[this.int_14];
				if (this.int_15 + num2 > this.int_13)
				{
					break;
				}
				while (num2-- > 0)
				{
					this.byte_1[this.int_15++] = this.byte_2;
				}
				if (this.int_15 != this.int_13)
				{
					this.int_9 = 4;
					continue;
				}
				goto IL_2FE;
				IL_1B8:
				this.int_12 = streamManipulator_0.PeekBits(4);
				if (this.int_12 >= 0)
				{
					this.int_12 += 4;
					streamManipulator_0.DropBits(4);
					this.byte_0 = new byte[19];
					this.int_15 = 0;
					this.int_9 = 3;
					goto IL_17D;
				}
				goto IL_2DE;
				IL_20B:
				this.int_11 = streamManipulator_0.PeekBits(5);
				if (this.int_11 >= 0)
				{
					this.int_11++;
					streamManipulator_0.DropBits(5);
					this.int_13 = this.int_10 + this.int_11;
					this.byte_1 = new byte[this.int_13];
					this.int_9 = 2;
					goto IL_1B8;
				}
				goto IL_2DA;
			}
			throw new SharpZipBaseException();
			IL_2D6:
			bool result = false;
			return result;
			IL_2DA:
			result = false;
			return result;
			IL_2DE:
			result = false;
			return result;
			IL_2E2:
			result = false;
			return result;
			IL_2E6:
			result = false;
			return result;
			IL_2EA:
			throw new SharpZipBaseException();
			IL_2F0:
			result = true;
			return result;
			IL_2F4:
			result = false;
			return result;
			IL_2FE:
			result = true;
			return result;
		}
		public InflaterHuffmanTree method_1()
		{
			byte[] array = new byte[this.int_10];
			Array.Copy(this.byte_1, 0, array, 0, this.int_10);
			return new InflaterHuffmanTree(array);
		}
		public InflaterHuffmanTree method_2()
		{
			byte[] array = new byte[this.int_11];
			Array.Copy(this.byte_1, this.int_10, array, 0, this.int_11);
			return new InflaterHuffmanTree(array);
		}
	}
	public class InflaterHuffmanTree
	{
		private const int int_0 = 15;
		private short[] short_0;
		public static InflaterHuffmanTree defLitLenTree;
		public static InflaterHuffmanTree defDistTree;
		static InflaterHuffmanTree()
		{
			try
			{
				byte[] array = new byte[288];
				int i = 0;
				while (i < 144)
				{
					array[i++] = 8;
				}
				while (i < 256)
				{
					array[i++] = 9;
				}
				while (i < 280)
				{
					array[i++] = 7;
				}
				while (i < 288)
				{
					array[i++] = 8;
				}
				InflaterHuffmanTree.defLitLenTree = new InflaterHuffmanTree(array);
				array = new byte[32];
				i = 0;
				while (i < 32)
				{
					array[i++] = 5;
				}
				InflaterHuffmanTree.defDistTree = new InflaterHuffmanTree(array);
			}
			catch (Exception)
			{
				throw new SharpZipBaseException("InflaterHuffmanTree: static tree length illegal");
			}
		}
		public InflaterHuffmanTree(byte[] codeLengths)
		{
			this.method_0(codeLengths);
		}
		private void method_0(byte[] byte_0)
		{
			int[] array = new int[16];
			int[] array2 = new int[16];
			for (int i = 0; i < byte_0.Length; i++)
			{
				int j = (int)byte_0[i];
				if (j > 0)
				{
					array[j]++;
				}
			}
			int num = 0;
			int num2 = 512;
			for (int j = 1; j <= 15; j++)
			{
				array2[j] = num;
				num += array[j] << 16 - j;
				if (j >= 10)
				{
					int num3 = array2[j] & 130944;
					int num4 = num & 130944;
					num2 += num4 - num3 >> 16 - j;
				}
			}
			this.short_0 = new short[num2];
			int num5 = 512;
			for (int j = 15; j >= 10; j--)
			{
				int num4 = num & 130944;
				num -= array[j] << 16 - j;
				int num3 = num & 130944;
				for (int i = num3; i < num4; i += 128)
				{
					this.short_0[(int)DeflaterHuffman.BitReverse(i)] = (short)(-num5 << 4 | j);
					num5 += 1 << j - 9;
				}
			}
			for (int i = 0; i < byte_0.Length; i++)
			{
				int j = (int)byte_0[i];
				if (j != 0)
				{
					num = array2[j];
					int num6 = (int)DeflaterHuffman.BitReverse(num);
					if (j <= 9)
					{
						do
						{
							this.short_0[num6] = (short)(i << 4 | j);
							num6 += 1 << j;
						}
						while (num6 < 512);
					}
					else
					{
						int num7 = (int)this.short_0[num6 & 511];
						int num8 = 1 << (num7 & 15);
						num7 = -(num7 >> 4);
						do
						{
							this.short_0[num7 | num6 >> 9] = (short)(i << 4 | j);
							num6 += 1 << j;
						}
						while (num6 < num8);
					}
					array2[j] = num + (1 << 16 - j);
				}
			}
		}
		public int GetSymbol(StreamManipulator input)
		{
			int num;
			int result;
			if ((num = input.PeekBits(9)) >= 0)
			{
				int num2;
				if ((num2 = (int)this.short_0[num]) >= 0)
				{
					input.DropBits(num2 & 15);
					result = num2 >> 4;
				}
				else
				{
					int num3 = -(num2 >> 4);
					int bitCount = num2 & 15;
					if ((num = input.PeekBits(bitCount)) >= 0)
					{
						num2 = (int)this.short_0[num3 | num >> 9];
						input.DropBits(num2 & 15);
						result = num2 >> 4;
					}
					else
					{
						int availableBits = input.AvailableBits;
						num = input.PeekBits(availableBits);
						num2 = (int)this.short_0[num3 | num >> 9];
						if ((num2 & 15) <= availableBits)
						{
							input.DropBits(num2 & 15);
							result = num2 >> 4;
						}
						else
						{
							result = -1;
						}
					}
				}
			}
			else
			{
				int availableBits = input.AvailableBits;
				num = input.PeekBits(availableBits);
				int num2 = (int)this.short_0[num];
				if (num2 >= 0 && (num2 & 15) <= availableBits)
				{
					input.DropBits(num2 & 15);
					result = num2 >> 4;
				}
				else
				{
					result = -1;
				}
			}
			return result;
		}
	}
}
namespace ICSharpCode.SharpZipLib.Zip
{
	public enum UseZip64
	{
		Off,
		On,
		Dynamic
	}
	public enum CompressionMethod
	{
		Stored,
		Deflated = 8,
		Deflate64,
		BZip2 = 11,
		WinZipAES = 99
	}
	public enum EncryptionAlgorithm
	{
		None,
		PkzipClassic,
		Des = 26113,
		RC2,
		TripleDes168,
		TripleDes112 = 26121,
		Aes128 = 26126,
		Aes192,
		Aes256,
		RC2Corrected = 26370,
		Blowfish = 26400,
		Twofish,
		RC4 = 26625,
		Unknown = 65535
	}
	[Flags]
	public enum GeneralBitFlags
	{
		Encrypted = 1,
		Method = 6,
		Descriptor = 8,
		ReservedPKware4 = 16,
		Patched = 32,
		StrongEncryption = 64,
		Unused7 = 128,
		Unused8 = 256,
		Unused9 = 512,
		Unused10 = 1024,
		UnicodeText = 2048,
		EnhancedCompress = 4096,
		HeaderMasked = 8192,
		ReservedPkware14 = 16384,
		ReservedPkware15 = 32768
	}
	public sealed class ZipConstants
	{
		public const int VersionMadeBy = 51;
		[Obsolete("Use VersionMadeBy instead")]
		public const int VERSION_MADE_BY = 51;
		public const int VersionStrongEncryption = 50;
		[Obsolete("Use VersionStrongEncryption instead")]
		public const int VERSION_STRONG_ENCRYPTION = 50;
		public const int VERSION_AES = 51;
		public const int VersionZip64 = 45;
		public const int LocalHeaderBaseSize = 30;
		[Obsolete("Use LocalHeaderBaseSize instead")]
		public const int LOCHDR = 30;
		public const int Zip64DataDescriptorSize = 24;
		public const int DataDescriptorSize = 16;
		[Obsolete("Use DataDescriptorSize instead")]
		public const int EXTHDR = 16;
		public const int CentralHeaderBaseSize = 46;
		[Obsolete("Use CentralHeaderBaseSize instead")]
		public const int CENHDR = 46;
		public const int EndOfCentralRecordBaseSize = 22;
		[Obsolete("Use EndOfCentralRecordBaseSize instead")]
		public const int ENDHDR = 22;
		public const int CryptoHeaderSize = 12;
		[Obsolete("Use CryptoHeaderSize instead")]
		public const int CRYPTO_HEADER_SIZE = 12;
		public const int LocalHeaderSignature = 67324752;
		[Obsolete("Use LocalHeaderSignature instead")]
		public const int LOCSIG = 67324752;
		public const int SpanningSignature = 134695760;
		[Obsolete("Use SpanningSignature instead")]
		public const int SPANNINGSIG = 134695760;
		public const int SpanningTempSignature = 808471376;
		[Obsolete("Use SpanningTempSignature instead")]
		public const int SPANTEMPSIG = 808471376;
		public const int DataDescriptorSignature = 134695760;
		[Obsolete("Use DataDescriptorSignature instead")]
		public const int EXTSIG = 134695760;
		[Obsolete("Use CentralHeaderSignature instead")]
		public const int CENSIG = 33639248;
		public const int CentralHeaderSignature = 33639248;
		public const int Zip64CentralFileHeaderSignature = 101075792;
		[Obsolete("Use Zip64CentralFileHeaderSignature instead")]
		public const int CENSIG64 = 101075792;
		public const int Zip64CentralDirLocatorSignature = 117853008;
		public const int ArchiveExtraDataSignature = 117853008;
		public const int CentralHeaderDigitalSignature = 84233040;
		[Obsolete("Use CentralHeaderDigitalSignaure instead")]
		public const int CENDIGITALSIG = 84233040;
		public const int EndOfCentralDirectorySignature = 101010256;
		[Obsolete("Use EndOfCentralDirectorySignature instead")]
		public const int ENDSIG = 101010256;
		public static string ConvertToString(byte[] data, int count)
		{
			string result;
			if (data == null)
			{
				result = string.Empty;
			}
			else
			{
				result = Encoding.get_Unicode().GetString(data, 0, count);
			}
			return result;
		}
		public static string ConvertToString(byte[] data)
		{
			string result;
			if (data == null)
			{
				result = string.Empty;
			}
			else
			{
				result = ZipConstants.ConvertToString(data, data.Length);
			}
			return result;
		}
		public static string ConvertToStringExt(int flags, byte[] data, int count)
		{
			string result;
			if (data == null)
			{
				result = string.Empty;
			}
			else
			{
				if ((flags & 2048) != 0)
				{
					result = Encoding.get_UTF8().GetString(data, 0, count);
				}
				else
				{
					result = ZipConstants.ConvertToString(data, count);
				}
			}
			return result;
		}
		public static string ConvertToStringExt(int flags, byte[] data)
		{
			string result;
			if (data == null)
			{
				result = string.Empty;
			}
			else
			{
				if ((flags & 2048) != 0)
				{
					result = Encoding.get_UTF8().GetString(data, 0, data.Length);
				}
				else
				{
					result = ZipConstants.ConvertToString(data, data.Length);
				}
			}
			return result;
		}
		public static byte[] ConvertToArray(string string_0)
		{
			byte[] result;
			if (string_0 == null)
			{
				result = new byte[0];
			}
			else
			{
				result = Encoding.get_Unicode().GetBytes(string_0);
			}
			return result;
		}
		public static byte[] ConvertToArray(int flags, string string_0)
		{
			byte[] result;
			if (string_0 == null)
			{
				result = new byte[0];
			}
			else
			{
				if ((flags & 2048) != 0)
				{
					result = Encoding.get_UTF8().GetBytes(string_0);
				}
				else
				{
					result = ZipConstants.ConvertToArray(string_0);
				}
			}
			return result;
		}
		private ZipConstants()
		{
		}
	}
	public class ZipException : SharpZipBaseException
	{
		public ZipException()
		{
		}
		public ZipException(string message) : base(message)
		{
		}
		public ZipException(string message, Exception exception) : base(message, exception)
		{
		}
	}
}

// D:\tools\weixin\new\MicroMsg-cleaned.dll
// MicroMsg, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

// 架　构: AnyCPU (优先64位)
// 运行时: .NET 2.0

